Skip to content

Commit

Permalink
some minor changes in articleDetail.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
bugudiramu committed Sep 7, 2019
1 parent 79546f2 commit a331965
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 34 deletions.
Binary file removed images/no_internet.gif
Binary file not shown.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class MyApp extends StatelessWidget {
fontFamily: "Montserrat",
// Dynamic font styles
textTheme: TextTheme(
headline: TextStyle(fontWeight: FontWeight.w800, fontSize: 23.0),
headline: TextStyle(fontWeight: FontWeight.w900, fontSize: 20.0),
body2: TextStyle(fontStyle: FontStyle.italic),
subhead: TextStyle(fontWeight: FontWeight.bold),
subhead: TextStyle(fontWeight: FontWeight.w400),
),
),
);
Expand Down
68 changes: 41 additions & 27 deletions lib/ui/articleDetail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,58 @@ class _ArticleDetailState extends State<ArticleDetail> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("BuzzyFeed"),
// title: Text("BuzzyFeed"),
elevation: 0.0,
centerTitle: true,
),
body: Container(
padding: EdgeInsets.only(top: 5.0),
// padding: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: ListView(
children: <Widget>[
//Back arrow
// Container(
// alignment: Alignment.topLeft,
// child: IconButton(
// icon: Icon(Icons.arrow_back),
// onPressed: () => Navigator.of(context).pop(),
// ),
// ),
// Image
Container(
alignment: Alignment.center,
// padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 20.0),
child: Stack(
children: <Widget>[
Hero(
tag: widget.articles['title'],
child: FadeInImage.assetNetwork(
alignment: Alignment.center,
fit: BoxFit.cover,
height: 280.0,
// width: MediaQuery.of(context).size.width,
placeholder: 'images/loading.gif',
image: widget.articles['urlToImage'] == null
? Image.asset(
'images/imgPlaceholder.png',
).toString()
: widget.articles['urlToImage'],
),
),
],
),
),
SizedBox(height: 5.0),
// Title
Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0),
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 8.0),
child: Text(
"${widget.articles['title'] == null ? 'Title Here' : widget.articles['title']}",
style: Theme.of(context).textTheme.headline,
),
),
Divider(),

// Author name
Container(
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 8.0),
Expand Down Expand Up @@ -66,37 +101,16 @@ class _ArticleDetailState extends State<ArticleDetail> {
Padding(
padding: EdgeInsets.only(bottom: 10.0),
),
// Image
Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 20.0),
child: Stack(
children: <Widget>[
Hero(
tag: widget.articles['title'],
child: FadeInImage.assetNetwork(
alignment: Alignment.center,
fit: BoxFit.cover,
height: 280.0,
// width: MediaQuery.of(context).size.width,
placeholder: 'images/loading.gif',
image: widget.articles['urlToImage'] == null
? Image.asset(
'images/imgPlaceholder.png',
).toString()
: widget.articles['urlToImage'],
),
),
],
),
),
Divider(),

// Description
Container(
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 5.0),
child: Text(
"${widget.articles['description'] == null ? 'Description of Article' : widget.articles['description']}",
style: Theme.of(context).textTheme.subhead),
),
Divider(),
// Content
Container(
padding: EdgeInsets.symmetric(horizontal: 18.0, vertical: 5.0),
Expand Down
10 changes: 6 additions & 4 deletions lib/ui/articles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class _AllNewsState extends State<AllNews> with SingleTickerProviderStateMixin {
title: Container(
child: Stack(
// AlignmentDirectional is used to place the text whereever we wanted on the image
alignment: AlignmentDirectional(0, 1),
alignment: AlignmentDirectional(0, 0.9),

children: <Widget>[
// Hero animation
Expand All @@ -441,9 +441,11 @@ class _AllNewsState extends State<AllNews> with SingleTickerProviderStateMixin {
.toString(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.bold),
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.w300,
backgroundColor: Colors.black26,
),
),
),
],
Expand Down
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- images/loading.gif
- images/no_internet.gif
- images/icon/launcherIcon.png
- images/logout.png
- images/bg1.png
Expand Down

0 comments on commit a331965

Please sign in to comment.