Skip to content

Commit 3e88106

Browse files
committed
added some parts of post
1 parent 5053085 commit 3e88106

File tree

3 files changed

+123
-7
lines changed

3 files changed

+123
-7
lines changed

lib/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/material.dart';
22
import './appbar.dart';
3-
import './stories.dart';
4-
3+
import './posts.dart';
54
void main() => runApp(new MyApp());
65

76
class MyApp extends StatelessWidget {
@@ -16,6 +15,7 @@ class MyApp extends StatelessWidget {
1615
}
1716

1817
class MyHomePage extends StatelessWidget {
18+
// GlowingOverscrollIndicator({color: Colors.transparent,axisDirection: AxisDirection.down,});
1919
@override
2020
Widget build(BuildContext context) {
2121
return new Scaffold(
@@ -24,7 +24,7 @@ class MyHomePage extends StatelessWidget {
2424
child: new Column(
2525
children: <Widget>[
2626
new MyAppBar(),
27-
new MyStories()
27+
new PostWrapper(),
2828
],
2929
)
3030
),

lib/posts.dart

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
import 'package:flutter/material.dart';
2+
import './stories.dart';
3+
4+
class PostWrapper extends StatelessWidget {
5+
// PostWrapper.ScrollNotification();
6+
// MediaQuery.of(context).Size
7+
@override
8+
// void disallowGlow ()
9+
Widget build(BuildContext context) {
10+
final Size screenSize = MediaQuery.of(context).size;
11+
print(screenSize);
12+
return new Container(
13+
color: Colors.transparent,
14+
// height: screenSize.height - 150.0,
15+
constraints: new BoxConstraints(maxHeight: screenSize.height - 120.0),
16+
child: new ListView.builder(
17+
itemCount: 20,
18+
padding: new EdgeInsets.all(0.0),
19+
scrollDirection: Axis.vertical,
20+
// itemExtent: 130.0,
21+
itemBuilder: (context,index) {
22+
print(MediaQuery.of(context).size);
23+
if(index == 0) {
24+
return new MyStories();
25+
} else {
26+
return new Post();
27+
}
28+
},
29+
)
30+
);
31+
}
32+
}
33+
34+
class Post extends StatelessWidget{
35+
@override
36+
Widget build(BuildContext context) => new Container(
37+
child: new Column(
38+
children: <Widget>[
39+
new Row(
40+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
41+
children: <Widget>[
42+
new Container(
43+
margin: new EdgeInsets.only(top: 5.0,left: 5.0),
44+
child: new Row(
45+
children: <Widget>[
46+
new PostIcon(),
47+
new Container(
48+
padding: new EdgeInsets.only(left: 5.0),
49+
child: new Text('data',style: new TextStyle(fontSize: 12.0),),
50+
)
51+
],
52+
),
53+
),
54+
new IconButton(
55+
icon: new Icon(Icons.more_vert),
56+
)
57+
],
58+
)
59+
],
60+
),
61+
);
62+
}
63+
64+
class PostIcon extends StatelessWidget{
65+
@override
66+
Widget build(BuildContext context) => new Stack(
67+
children: <Widget>[
68+
new Container(
69+
height: 34.0,
70+
width: 34.0,
71+
decoration: new BoxDecoration(
72+
borderRadius: new BorderRadius.circular(50.5),
73+
gradient: new LinearGradient(
74+
colors: [
75+
const Color(0xFFfdf497),
76+
const Color(0xFFfd5949),
77+
const Color(0xFFd6249f),
78+
const Color(0xFF285AEB),
79+
],
80+
begin: Alignment.bottomLeft,
81+
end: Alignment.topRight,
82+
stops: [0.05,0.30,0.60, 1.0],
83+
tileMode: TileMode.clamp
84+
),
85+
),
86+
),
87+
new Container(
88+
height: 30.0,
89+
width: 30.0,
90+
margin: new EdgeInsets.only(top: 2.0,left: 2.0),
91+
decoration: new BoxDecoration(
92+
borderRadius: new BorderRadius.circular(50.5),
93+
border: new Border.all(
94+
width: 2.0,
95+
color: Colors.white
96+
)
97+
),
98+
child: new CircleAvatar(
99+
radius: 50.5,
100+
backgroundImage: new NetworkImage('https://instagram.fbom1-2.fna.fbcdn.net/vp/c3e31ba6c731d53a586571c7bf69b687/5B14A9B9/t51.2885-19/s150x150/25025729_167768233981692_3323823934234689536_n.jpg'),
101+
),
102+
),
103+
104+
],
105+
);
106+
}

lib/stories.dart

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ class MyStories extends StatelessWidget {
66
@override
77
Widget build(BuildContext context) {
88
return new Container(
9-
padding: new EdgeInsets.only(top: 10.0),
9+
// padding: new EdgeInsets.only(top: 10.0),
1010
// height: statusBarHeight + barHeight,
1111
decoration: new BoxDecoration(
1212
color: Colors.transparent,
13+
// border: new Border(bottom: new BorderSide(color: Colors.black12))
1314
),
1415
child: new Column(
1516
children: <Widget>[
@@ -25,7 +26,9 @@ class MyStories extends StatelessWidget {
2526
),
2627
),
2728
new FlatButton(
29+
splashColor: Colors.transparent,
2830
color: Colors.transparent,
31+
highlightColor: Colors.transparent,
2932
onPressed: () => Scaffold.of(context).showSnackBar(new SnackBar(content: new Text('watch all'))),
3033
child: new Row(
3134
children: <Widget>[
@@ -38,12 +41,12 @@ class MyStories extends StatelessWidget {
3841
),
3942

4043
new Container(
41-
constraints: new BoxConstraints(maxWidth: double.INFINITY,maxHeight: 120.0),
44+
constraints: new BoxConstraints(maxWidth: double.INFINITY,maxHeight: 90.0),
4245
child: new ListView.builder(
4346
scrollDirection: Axis.horizontal,
4447
itemCount: 10,
45-
itemExtent: 100.0,
46-
padding: new EdgeInsets.all(10.0),
48+
itemExtent: 90.0,
49+
// padding: new EdgeInsets.all(10.0),
4750
itemBuilder: (context, int) {return new StoryBuilder(int);} ,
4851
),
4952
),
@@ -112,6 +115,13 @@ class StoryBuilder extends StatelessWidget{
112115
);
113116
}
114117
}
118+
119+
// class SmallStoryIcon extends StatelessWidget{
120+
// @override
121+
// Widget build(BuildContext context) => new Container(
122+
123+
// );
124+
// }
115125
// new Container(
116126
// margin: new EdgeInsets.all(10.0),
117127
// decoration: new BoxDecoration(

0 commit comments

Comments
 (0)