-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
329 additions
and
22 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter_social/models/user.dart'; | ||
import 'package:flutter_social/utils/utils.dart'; | ||
|
||
class Feed { | ||
int id, userId; | ||
String createdAt; | ||
String description = | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id neque libero. Donec finibus sem viverra.'; | ||
String bannerImg = AvailableImages.postBanner['assetPath']; | ||
String userName, userImage; | ||
|
||
Feed(this.id, this.createdAt, this.userId, this.userName, this.userImage); | ||
} | ||
|
||
final List<Feed> feeds = [ | ||
Feed(1, '19 Aug', users[0].id, users[0].name, users[0].photo), | ||
Feed(2, '20 Aug', users[1].id, users[1].name, users[1].photo), | ||
Feed(3, '22 Aug', users[2].id, users[2].name, users[2].photo), | ||
Feed(4, '1 Sept', users[3].id,users[3].name, users[3].photo), | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter_social/utils/utils.dart'; | ||
|
||
class User { | ||
int id; | ||
String name; | ||
String photo; | ||
|
||
User(this.id, this.name, this.photo); | ||
} | ||
|
||
|
||
// Names generated at http://random-name-generator.info/ | ||
final List<User> users = [ | ||
User(1, 'Matt Maxwell', AvailableImages.man1['assetPath']), | ||
User(2, 'Maria Perez', AvailableImages.woman1['assetPath']), | ||
User(3, 'Craig Jordan', AvailableImages.man2['assetPath']), | ||
User(4, 'Charlotte Mckenzie', AvailableImages.woman2['assetPath']), | ||
User(5, 'Rita Pena', AvailableImages.woman3['assetPath']), | ||
User(6, 'Robin Mcguire', AvailableImages.man3['assetPath']), | ||
User(7, 'Angelina Love', AvailableImages.woman4['assetPath']), | ||
User(8, 'Louis Diaz', AvailableImages.man4['assetPath']), | ||
User(9, 'Kyle Poole', AvailableImages.man5['assetPath']), | ||
User(10, 'Brenda Watkins', AvailableImages.woman5['assetPath']), | ||
]; |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_social/models/feed.dart'; | ||
import 'package:flutter_social/widgets/feed_card1.dart'; | ||
|
||
class FeedsPage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
final appBar = Padding( | ||
padding: EdgeInsets.only(right: 15.0, left: 15.0), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: <Widget>[ | ||
IconButton( | ||
onPressed: () => Navigator.pop(context), | ||
icon: Icon( | ||
Icons.arrow_back, | ||
color: Colors.black, | ||
), | ||
) | ||
], | ||
), | ||
); | ||
|
||
final pageTitle = Padding( | ||
padding: EdgeInsets.only(top: 1.0, bottom: 30.0), | ||
child: Text( | ||
"Feed", | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
color: Colors.black, | ||
fontSize: 40.0, | ||
), | ||
), | ||
); | ||
|
||
return Scaffold( | ||
body: SingleChildScrollView( | ||
child: Container( | ||
color: Colors.grey.withOpacity(0.1), | ||
padding: EdgeInsets.only(top: 40.0), | ||
height: MediaQuery.of(context).size.height, | ||
width: MediaQuery.of(context).size.width, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
appBar, | ||
Container( | ||
padding: EdgeInsets.only(left: 30.0, right: 30.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
pageTitle, | ||
FeedCard1(feed: feeds[0]) | ||
], | ||
), | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_social/models/feed.dart'; | ||
import 'package:line_icons/line_icons.dart'; | ||
|
||
class FeedCard1 extends StatelessWidget { | ||
final Feed feed; | ||
|
||
const FeedCard1({Key key, this.feed}) : super(key: key); | ||
@override | ||
Widget build(BuildContext context) { | ||
final userimage = Container( | ||
margin: EdgeInsets.only(right: 10.0), | ||
height: 40.0, | ||
width: 40.0, | ||
decoration: BoxDecoration( | ||
image: DecorationImage( | ||
image: AssetImage(feed.userImage), fit: BoxFit.cover), | ||
borderRadius: BorderRadius.circular(7.0), | ||
), | ||
); | ||
|
||
final headerDesc = Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
feed.userName, | ||
style: TextStyle( | ||
color: Colors.black, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
Text( | ||
feed.createdAt, | ||
style: TextStyle( | ||
color: Colors.grey.withOpacity(0.6), | ||
fontWeight: FontWeight.bold, | ||
), | ||
) | ||
], | ||
); | ||
|
||
final header = Row( | ||
mainAxisAlignment: MainAxisAlignment.start, | ||
children: <Widget>[userimage, headerDesc], | ||
); | ||
|
||
final descriptionText = Container( | ||
height: 80.0, | ||
child: Text( | ||
feed.description, | ||
style: TextStyle( | ||
color: Colors.grey, | ||
fontWeight: FontWeight.w600, | ||
fontSize: 16.0, | ||
), | ||
), | ||
); | ||
|
||
final divider = Divider( | ||
color: Colors.grey.withOpacity(0.6), | ||
); | ||
|
||
final footer = Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
Icon(Icons.share), | ||
Row( | ||
children: <Widget>[ | ||
Text('256'), | ||
SizedBox( | ||
width: 3.0, | ||
), | ||
Icon(LineIcons.comments), | ||
SizedBox( | ||
width: 30.0, | ||
), | ||
Text('4k'), | ||
SizedBox( | ||
width: 3.0, | ||
), | ||
Icon(LineIcons.heart_o), | ||
], | ||
), | ||
], | ||
); | ||
|
||
return Container( | ||
height: 300.0, | ||
child: Stack( | ||
children: <Widget>[ | ||
Container( | ||
height: 150.0, | ||
width: MediaQuery.of(context).size.width, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(14.0), | ||
image: DecorationImage( | ||
image: AssetImage(feed.bannerImg), | ||
fit: BoxFit.cover, | ||
), | ||
boxShadow: [ | ||
BoxShadow( | ||
blurRadius: 3.0, | ||
color: Colors.grey.withOpacity(0.6), | ||
spreadRadius: 3.0, | ||
) | ||
], | ||
), | ||
), | ||
Positioned( | ||
top: 90.0, | ||
left: 0.0, | ||
right: 0.0, | ||
child: Padding( | ||
padding: EdgeInsets.only(left: 10.0, right: 10.0), | ||
child: Container( | ||
height: 200.0, | ||
width: 20.0, | ||
decoration: BoxDecoration( | ||
color: Colors.white, | ||
borderRadius: BorderRadius.circular(14.0), | ||
boxShadow: [ | ||
BoxShadow( | ||
blurRadius: 0.0, | ||
color: Colors.white, | ||
spreadRadius: 0.0, | ||
) | ||
], | ||
), | ||
child: Padding( | ||
padding: EdgeInsets.only( | ||
top: 20.0, | ||
bottom: 00.0, | ||
left: 20.0, | ||
right: 20.0, | ||
), | ||
child: Column( | ||
children: <Widget>[ | ||
header, | ||
SizedBox( | ||
height: 10.0, | ||
), | ||
descriptionText, | ||
divider, | ||
footer | ||
], | ||
), | ||
), | ||
), | ||
), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} |
Empty file.
Empty file.
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