This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: Container( | |
alignment: Alignment.topCenter, | |
child: ListView( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class ListItem extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
child: Row( | |
children: <Widget>[ | |
Text( | |
"Dummy title", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: Container( | |
child: ListView.builder( | |
itemCount: 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class ListItem extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
child: Row( | |
children: <Widget>[ | |
Image.network("https://github.com/agarasul/SampleNewsApp/raw/master/empty_image.png"), | |
Text( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Container( | |
height: 80, | |
width: 100, | |
child: Image.network( | |
"https://github.com/agarasul/SampleNewsApp/raw/master/empty_image.png") | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Padding( | |
padding: EdgeInsets.all(8), | |
child: Row( | |
children: <Widget>[ | |
Text("Dummy title"), | |
Text("Dummy description") | |
], | |
), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Padding( | |
padding: EdgeInsets.all(8), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: <Widget>[ | |
Text("Dummy title"), | |
Text("Dummy description") | |
]), | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class News { | |
String status; | |
String error; | |
int totalResults; | |
List<Article> articles; | |
News({this.status, this.articles}); | |
News.fromJson(Map<String, dynamic> newsJson) | |
: status = newsJson['status'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Article { | |
Source source; | |
String author; | |
Article.fromJson(Map<String, dynamic> articleJson) | |
: source = Source.fromJson(articleJson['source']), | |
author = articleJson['author'] | |
} | |
class Source { |
OlderNewer