Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Ajmal VA/APK/app-release.apk
Binary file not shown.
Binary file added Ajmal VA/Code/assets/aju.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Ajmal VA/Code/lib/api/news.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'dart:convert';

import 'package:http/http.dart' as http;
import 'package:newzera/model/article_model.dart';

class News {
String url =
"https://newsapi.org/v2/top-headlines?country=in&apiKey=ec5d8feba97048dda8411c6ac78aead2";
Future<Article> getNews() async {
var response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
// print(response.body);
return Article.fromJson(jsonDecode(response.body));
} else {
throw Exception("API Call Failed!");
}
}
}
25 changes: 25 additions & 0 deletions Ajmal VA/Code/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:newzera/screen/aboutus.dart';
import 'screen/config/themes/themes.dart';
import 'screen/details/detail_news.dart';
import 'screen/home/home_page.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'News App',
theme: themes(),
debugShowCheckedModeBanner: false,
routes: {
DetailNews.routeName: (ctx) => DetailNews(),
AboutUS.routeName: (ctx) => AboutUS(),
},
home: Homepage(),
);
}
}
91 changes: 91 additions & 0 deletions Ajmal VA/Code/lib/model/article_model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
class Article {
Article({
required this.status,
required this.totalResults,
required this.articles,
});
late final String status;
late final int totalResults;
late final List<Articles> articles;

Article.fromJson(Map<String, dynamic> json) {
status = json['status'];
totalResults = json['totalResults'];
articles =
List.from(json['articles']).map((e) => Articles.fromJson(e)).toList();
}

Map<String, dynamic> toJson() {
final _data = <String, dynamic>{};
_data['status'] = status;
_data['totalResults'] = totalResults;
_data['articles'] = articles.map((e) => e.toJson()).toList();
return _data;
}
}

class Articles {
Articles({
required this.source,
this.author,
required this.title,
this.description,
required this.url,
required this.urlToImage,
required this.publishedAt,
this.content,
});
late final Source source;
late final String? author;
late final String? title;
late final String? description;
late final String? url;
late final String? urlToImage;
late final String? publishedAt;
late final String? content;

Articles.fromJson(Map<String, dynamic> json) {
source = Source.fromJson(json['source']);
author = null;
title = json['title'];
description = json['description'];
url = json['url'];
urlToImage = json['urlToImage'];
publishedAt = json['publishedAt'];
content = null;
}

Map<String, dynamic> toJson() {
final _data = <String, dynamic>{};
_data['source'] = source.toJson();
_data['author'] = author;
_data['title'] = title;
_data['description'] = description;
_data['url'] = url;
_data['urlToImage'] = urlToImage;
_data['publishedAt'] = publishedAt;
_data['content'] = content;
return _data;
}
}

class Source {
Source({
this.id,
required this.name,
});
late final String? id;
late final String name;

Source.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}

Map<String, dynamic> toJson() {
final _data = <String, dynamic>{};
_data['id'] = id;
_data['name'] = name;
return _data;
}
}
216 changes: 216 additions & 0 deletions Ajmal VA/Code/lib/screen/aboutus.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';

class AboutUS extends StatelessWidget {
static const routeName = 'AboutUS';

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back_ios),
onPressed: () {
Navigator.of(context).pop();
},
color: Colors.white,
),
actions: <Widget>[
Padding(
padding: EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {},
child: Icon(
Icons.share,
size: 26.0,
),
)),
Padding(
padding: EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {},
child: Icon(Icons.more_vert),
)),
],
elevation: 0,
backgroundColor: Colors.pink.shade500,
),
body: Container(
height: 700,
width: double.infinity,
padding: EdgeInsets.all(10),
//color: Colors.green,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.red, Colors.purple],
begin: Alignment.topRight,
end: Alignment.bottomLeft,
),
),
child: Column(
children: [
SizedBox(height: 20),
const CircleAvatar(
//backgroundColor: Colors.brown,
//child: Text('Aju'),
backgroundImage: AssetImage('assets/aju.jpg'),
radius: 70,
),
Spacer(),
const Align(
child: Text(
'Ajmal VA',
style: TextStyle(fontSize: 30, color: Colors.white),
),
alignment: Alignment.center,
),
Spacer(),
const Align(
child: Text(
'Your Awesome App Developer',
style: TextStyle(fontSize: 20, color: Colors.white),
),
alignment: Alignment.center,
),
const Spacer(),
const Divider(
color: Colors.white,
thickness: 3,
),
const Spacer(),
Row(
children: const [
Text(
'Email',
style: TextStyle(fontSize: 20, color: Colors.white),
),
Spacer(),
Text(
'ajmal.va@gmail.com',
style: TextStyle(fontSize: 20, color: Colors.white),
),
],
),
Spacer(),
Divider(
color: Colors.white,
thickness: 3,
),
Spacer(),
Row(
children: const [
Text(
'Phone',
style: TextStyle(fontSize: 20, color: Colors.white),
),
Spacer(),
Text(
'+91 1234567890',
style: TextStyle(fontSize: 20, color: Colors.white),
),
],
),
Spacer(),
Divider(
color: Colors.white,
thickness: 3,
),
Spacer(),
Row(
children: const [
Text(
'Date of Birth',
style: TextStyle(fontSize: 20, color: Colors.white),
),
Spacer(),
Text(
'18/12/2000',
style: TextStyle(fontSize: 20, color: Colors.white),
),
],
),
Spacer(),
Divider(
color: Colors.white,
thickness: 3,
),
Spacer(),
Row(
children: const [
Text(
'address',
style: TextStyle(fontSize: 20, color: Colors.white),
),
Spacer(),
Text(
'IJK,Thrissur',
style: TextStyle(fontSize: 20, color: Colors.white),
),
],
),
Spacer(),
Divider(
color: Colors.white,
thickness: 3,
),
Row(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: IconButton(
icon: FaIcon(FontAwesomeIcons.facebookSquare,
size: 30, color: Colors.white),
onPressed: () {
print("Facebook/Ajmalva");
}),
),
Spacer(),
Padding(
padding: EdgeInsets.all(8.0),
child: IconButton(
icon: FaIcon(FontAwesomeIcons.github,
size: 30, color: Colors.white),
onPressed: () {
print("github.com/Ajmalva");
}),
),
Spacer(),
Padding(
padding: EdgeInsets.all(8.0),
child: IconButton(
icon: FaIcon(FontAwesomeIcons.instagram,
size: 30, color: Colors.white),
onPressed: () {
print("Ajmal VA");
}),
),
Spacer(),
Padding(
padding: EdgeInsets.all(8.0),
child: IconButton(
icon: FaIcon(FontAwesomeIcons.linkedin,
size: 30, color: Colors.white),
onPressed: () {
print("Ajmal VA");
}),
),
Spacer(),
Padding(
padding: EdgeInsets.all(8.0),
child: IconButton(
icon: FaIcon(FontAwesomeIcons.reddit,
size: 30, color: Colors.white),
onPressed: () {
print("Ajmal VA");
}),
),
Spacer(),
],
),
Spacer(),
],
),
),
);
}
}
17 changes: 17 additions & 0 deletions Ajmal VA/Code/lib/screen/config/themes/themes.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';

ThemeData themes() {
return ThemeData(
primarySwatch: Colors.blue,
textTheme: const TextTheme(
bodyText1: TextStyle(color: Colors.black45),
),
primaryTextTheme: TextTheme(
headline3:
TextStyle(color: Colors.indigo.shade900, fontWeight: FontWeight.w600),
headline5: TextStyle(color: Colors.indigo.shade900),
bodyText1: TextStyle(color: Colors.indigo.shade900),
),
);
}
5 changes: 5 additions & 0 deletions Ajmal VA/Code/lib/screen/config/var/var.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const String profileimage =
'https://images.unsplash.com/photo-1632570695117-633536e178ff?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=387&q=80';

const String webimg =
'https://images.unsplash.com/photo-1593642531955-b62e17bdaa9c?ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1169&q=80';
Loading