Skip to content

Commit 27be94a

Browse files
committed
completed blogging screen types three and four
1 parent f363558 commit 27be94a

File tree

7 files changed

+483
-3
lines changed

7 files changed

+483
-3
lines changed

assets/icons/placeholder_icon.svg

Lines changed: 6 additions & 0 deletions
Loading

lib/blog/blog_card_type_three.dart

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import 'package:contraflutterkit/login/login_text.dart';
2+
import 'package:contraflutterkit/utils/colors.dart';
3+
import 'package:flutter/cupertino.dart';
4+
import 'package:flutter/material.dart';
5+
6+
import 'blog.dart';
7+
8+
class BlogCardTypeThree extends StatelessWidget {
9+
final VoidCallback onTap;
10+
final Blog blog;
11+
12+
const BlogCardTypeThree({this.onTap, this.blog});
13+
14+
@override
15+
Widget build(BuildContext context) {
16+
return GestureDetector(
17+
onTap: onTap,
18+
child: Container(
19+
margin: EdgeInsets.only(top: 24),
20+
padding: EdgeInsets.all(24),
21+
decoration: ShapeDecoration(
22+
color: blog.bgColor,
23+
shadows: [
24+
BoxShadow(
25+
color: wood_smoke,
26+
offset: Offset(
27+
0.0, // Move to right 10 horizontally
28+
4.0, // Move to bottom 5 Vertically
29+
),
30+
)
31+
],
32+
shape: RoundedRectangleBorder(
33+
borderRadius: BorderRadius.all(Radius.circular(16)),
34+
side: BorderSide(color: wood_smoke, width: 2))),
35+
child: Column(
36+
crossAxisAlignment: CrossAxisAlignment.start,
37+
children: <Widget>[
38+
Row(
39+
children: <Widget>[
40+
Image.asset(
41+
"assets/images/peep_avatar.png",
42+
width: 48,
43+
height: 48,
44+
),
45+
Text(
46+
"Lamborci Mona",
47+
style: TextStyle(
48+
color: wood_smoke,
49+
fontSize: 15,
50+
fontWeight: FontWeight.w800),
51+
)
52+
],
53+
),
54+
SizedBox(
55+
height: 24,
56+
),
57+
Text(
58+
"Work with us and forget about others",
59+
style: TextStyle(
60+
fontSize: 36,
61+
fontWeight: FontWeight.bold,
62+
color: wood_smoke),
63+
),
64+
SizedBox(
65+
height: 48,
66+
),
67+
Row(
68+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
69+
children: <Widget>[
70+
Expanded(
71+
flex: 1,
72+
child: Row(
73+
children: <Widget>[
74+
Expanded(
75+
flex: 1,
76+
child: Row(
77+
children: <Widget>[
78+
Icon(
79+
Icons.chat_bubble_outline,
80+
color: wood_smoke,
81+
),
82+
LoginText(
83+
text: "324",
84+
size: 13,
85+
alignment: Alignment.center,
86+
)
87+
],
88+
),
89+
),
90+
Expanded(
91+
flex: 1,
92+
child: Row(
93+
children: <Widget>[
94+
Icon(
95+
Icons.favorite_border,
96+
color: wood_smoke,
97+
),
98+
LoginText(
99+
text: "3.2k",
100+
size: 13,
101+
alignment: Alignment.center,
102+
)
103+
],
104+
),
105+
)
106+
],
107+
),
108+
),
109+
Expanded(
110+
flex: 1,
111+
child: Row(
112+
mainAxisAlignment: MainAxisAlignment.end,
113+
children: [
114+
Icon(
115+
Icons.share,
116+
color: wood_smoke,
117+
),
118+
],
119+
),
120+
),
121+
],
122+
)
123+
],
124+
),
125+
));
126+
}
127+
}

lib/blog/blog_list_item.dart

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
import 'package:contraflutterkit/login/login_text.dart';
2+
import 'package:contraflutterkit/utils/colors.dart';
3+
import 'package:flutter/material.dart';
4+
5+
import 'blog.dart';
6+
7+
class BlogListItem extends StatelessWidget {
8+
final Blog blog;
9+
final VoidCallback onTap;
10+
11+
const BlogListItem({this.blog, this.onTap});
12+
13+
@override
14+
Widget build(BuildContext context) {
15+
return GestureDetector(
16+
onTap: onTap,
17+
child: Container(
18+
margin: EdgeInsets.only(top: 24),
19+
padding: EdgeInsets.all(24),
20+
child: Row(
21+
children: <Widget>[
22+
Expanded(
23+
flex: 1,
24+
child: Container(
25+
width: 100,
26+
height: 100,
27+
// child: SvgPicture.asset(
28+
// "assets/icons/placeholder_icon.svg",
29+
// width: 40,
30+
// height: 40,
31+
// ),
32+
child: Icon(
33+
Icons.image,
34+
color: white,
35+
size: 40,
36+
),
37+
decoration: ShapeDecoration(
38+
color: blog.bgColor,
39+
shape: RoundedRectangleBorder(
40+
borderRadius: BorderRadius.all(Radius.circular(16)),
41+
side: BorderSide(color: wood_smoke, width: 2))),
42+
),
43+
),
44+
SizedBox(
45+
width: 24,
46+
),
47+
Expanded(
48+
flex: 3,
49+
child: Column(
50+
crossAxisAlignment: CrossAxisAlignment.start,
51+
children: <Widget>[
52+
Text(
53+
"12 March, 20",
54+
style: TextStyle(
55+
fontSize: 11,
56+
fontWeight: FontWeight.bold,
57+
color: trout),
58+
),
59+
SizedBox(
60+
height: 12,
61+
),
62+
Text(
63+
"I’m post title, Please 2 line only...",
64+
style: TextStyle(
65+
fontWeight: FontWeight.bold,
66+
color: wood_smoke,
67+
fontSize: 21),
68+
),
69+
SizedBox(
70+
height: 12,
71+
),
72+
Row(
73+
children: <Widget>[
74+
Expanded(
75+
flex: 1,
76+
child: Row(
77+
children: <Widget>[
78+
Icon(
79+
Icons.chat_bubble_outline,
80+
color: wood_smoke,
81+
),
82+
LoginText(
83+
text: "Comment",
84+
size: 13,
85+
alignment: Alignment.center,
86+
)
87+
],
88+
),
89+
),
90+
Expanded(
91+
flex: 1,
92+
child: Row(
93+
children: <Widget>[
94+
Icon(
95+
Icons.favorite_border,
96+
color: wood_smoke,
97+
),
98+
LoginText(
99+
text: "Like",
100+
size: 13,
101+
alignment: Alignment.center,
102+
)
103+
],
104+
),
105+
)
106+
],
107+
)
108+
],
109+
),
110+
)
111+
],
112+
),
113+
),
114+
);
115+
}
116+
}

lib/blog/blog_list_page_four.dart

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import 'package:contraflutterkit/custom_widgets/custom_app_bar.dart';
2+
import 'package:contraflutterkit/login/login_text.dart';
3+
import 'package:contraflutterkit/utils/colors.dart';
4+
import 'package:flutter/cupertino.dart';
5+
import 'package:flutter/material.dart';
6+
7+
import 'blog.dart';
8+
import 'blog_card_type_three.dart';
9+
10+
class BlogListPageFour extends StatefulWidget {
11+
@override
12+
_BlogListPageFourState createState() => _BlogListPageFourState();
13+
}
14+
15+
class _BlogListPageFourState extends State<BlogListPageFour> {
16+
List<Blog> _blogs = List<Blog>();
17+
18+
@override
19+
void initState() {
20+
super.initState();
21+
_blogs.add(Blog(
22+
bgColor: foam,
23+
time: "25 April, 20",
24+
title: "Work with us and forget about others",
25+
user: "Alisa Red",
26+
description:
27+
"Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea."));
28+
_blogs.add(Blog(
29+
bgColor: lavandar_bush,
30+
time: "1 Jan, 20",
31+
title: "Work with us and forget about others",
32+
user: "Riya Red",
33+
description:
34+
"Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea."));
35+
_blogs.add(Blog(
36+
bgColor: fair_pink,
37+
time: "30 March, 20",
38+
title: "Work with us and forget about others",
39+
user: "Con Red",
40+
description:
41+
"Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea."));
42+
_blogs.add(Blog(
43+
bgColor: athen_gray,
44+
time: "12 Dec, 20",
45+
title: "Work with us and forget about others",
46+
user: "Melyssa Chen",
47+
description:
48+
"Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea. Wireframe is still important for ideation. It will help you to quickly test idea."));
49+
}
50+
51+
@override
52+
Widget build(BuildContext context) {
53+
return Scaffold(
54+
appBar: CustomAppBar(
55+
height: 150,
56+
child: Column(
57+
mainAxisAlignment: MainAxisAlignment.end,
58+
children: [
59+
Padding(
60+
padding: const EdgeInsets.all(24.0),
61+
child: Row(
62+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
63+
children: <Widget>[
64+
Expanded(
65+
flex: 2,
66+
child: LoginText(
67+
size: 44,
68+
alignment: Alignment.bottomCenter,
69+
text: "Shop Yay",
70+
),
71+
),
72+
Expanded(
73+
flex: 1,
74+
child: Align(
75+
alignment: Alignment.centerRight,
76+
child: SizedBox(),
77+
),
78+
)
79+
],
80+
),
81+
),
82+
],
83+
),
84+
),
85+
body: ListView.builder(
86+
itemCount: _blogs.length,
87+
padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
88+
itemBuilder: (BuildContext context, int index) {
89+
return BlogCardTypeThree(
90+
blog: _blogs[index],
91+
onTap: () {
92+
Navigator.pushNamed(context, "/shopping_detail_page_two");
93+
},
94+
);
95+
}),
96+
);
97+
}
98+
}

0 commit comments

Comments
 (0)