Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b7448f4

Browse files
Home Page part completed
1 parent 8f54478 commit b7448f4

File tree

5 files changed

+74
-39
lines changed

5 files changed

+74
-39
lines changed

‎lib/Blog/Blog.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import 'package:flutter/material.dart';
2+
3+
class Blog extends StatelessWidget {
4+
const Blog({Key key}) : super(key: key);
5+
6+
@override
7+
Widget build(BuildContext context) {
8+
return Scaffold();
9+
}
10+
}

‎lib/Blog/Blogs.dart

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:blogapp/Blog/Blog.dart';
12
import 'package:blogapp/CustumWidget/BlogCard.dart';
23
import 'package:blogapp/Model/SuperModel.dart';
34
import 'package:blogapp/Model/addBlogModels.dart';
@@ -34,13 +35,30 @@ class _BlogsState extends State<Blogs> {
3435

3536
@override
3637
Widget build(BuildContext context) {
37-
return Column(
38-
children: data
39-
.map((item) => BlogCard(
40-
addBlogModel: item,
41-
networkHandler: networkHandler,
42-
))
43-
.toList(),
44-
);
38+
return data.length > 0
39+
? Column(
40+
children: data
41+
.map((item) => Column(
42+
children: <Widget>[
43+
InkWell(
44+
onTap: () {
45+
Navigator.push(context,
46+
MaterialPageRoute(builder: (contex) => Blog()));
47+
},
48+
child: BlogCard(
49+
addBlogModel: item,
50+
networkHandler: networkHandler,
51+
),
52+
),
53+
SizedBox(
54+
height: 10,
55+
),
56+
],
57+
))
58+
.toList(),
59+
)
60+
: Center(
61+
child: Text("We don't have any Blog Yet"),
62+
);
4563
}
4664
}

‎lib/CustumWidget/BlogCard.dart

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,42 @@ class BlogCard extends StatelessWidget {
1515
@override
1616
Widget build(BuildContext context) {
1717
return Container(
18-
height: 200,
19-
padding: EdgeInsets.all(5),
18+
height: 300,
19+
padding: EdgeInsets.all(15),
2020
width: MediaQuery.of(context).size.width,
21-
child: Stack(
22-
children: <Widget>[
23-
Container(
24-
height: MediaQuery.of(context).size.height,
25-
width: MediaQuery.of(context).size.width,
26-
decoration: BoxDecoration(
27-
image: DecorationImage(
28-
image: networkHandler.getImage(addBlogModel.id),
29-
fit: BoxFit.fitWidth),
30-
),
31-
),
32-
Positioned(
33-
bottom: 2,
34-
child: Container(
35-
padding: EdgeInsets.all(8),
36-
height: 55,
21+
child: Card(
22+
child: Stack(
23+
children: <Widget>[
24+
Container(
25+
height: MediaQuery.of(context).size.height,
3726
width: MediaQuery.of(context).size.width,
3827
decoration: BoxDecoration(
39-
color: Colors.white, borderRadius: BorderRadius.circular(8)),
40-
child: Text(
41-
addBlogModel.title,
42-
style: TextStyle(
43-
fontWeight: FontWeight.bold,
44-
fontSize: 15,
45-
),
28+
image: DecorationImage(
29+
image: networkHandler.getImage(addBlogModel.id),
30+
fit: BoxFit.fitWidth),
4631
),
4732
),
48-
)
49-
],
33+
Positioned(
34+
bottom: 2,
35+
child: Container(
36+
padding: EdgeInsets.all(8),
37+
height: 60,
38+
width: MediaQuery.of(context).size.width,
39+
decoration: BoxDecoration(
40+
color: Colors.white,
41+
borderRadius: BorderRadius.circular(8)),
42+
child: Text(
43+
addBlogModel.title,
44+
textAlign: TextAlign.center,
45+
style: TextStyle(
46+
fontWeight: FontWeight.bold,
47+
fontSize: 15,
48+
),
49+
),
50+
),
51+
)
52+
],
53+
),
5054
),
5155
);
5256
}

‎lib/Profile/CreatProfile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class _CreatProfileState extends State<CreatProfile> {
6565
Map<String, String> data = {
6666
"name": _name.text,
6767
"profession": _profession.text,
68-
"dob": _dob.text,
69-
"title": _title.text,
68+
"DOB": _dob.text,
69+
"titleline": _title.text,
7070
"about": _about.text,
7171
};
7272
var response =

‎lib/Screen/HomeScreen.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:blogapp/Blog/Blogs.dart';
12
import 'package:flutter/material.dart';
23

34
class HomeScreen extends StatefulWidget {
@@ -11,8 +12,10 @@ class _HomeScreenState extends State<HomeScreen> {
1112
@override
1213
Widget build(BuildContext context) {
1314
return Scaffold(
14-
body: Center(
15-
child: Text("Home page"),
15+
body: SingleChildScrollView(
16+
child: Blogs(
17+
url: "/blogpost/getOtherBlog",
18+
),
1619
),
1720
);
1821
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /