Skip to content

Commit 2097e16

Browse files
committed
profile data changed
1 parent da56314 commit 2097e16

File tree

5 files changed

+107
-21
lines changed

5 files changed

+107
-21
lines changed

lib/Pages/HomePage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:blogapp/Screen/HomeScreen.dart';
2-
import 'package:blogapp/Screen/ProfileScreen.dart';
2+
import 'package:blogapp/Profile/ProfileScreen.dart';
33
import 'package:flutter/material.dart';
44

55
class HomePage extends StatefulWidget {

lib/Profile/CreatProfile.dart

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import 'package:flutter/material.dart';
2+
3+
class CreatProfile extends StatefulWidget {
4+
CreatProfile({Key key}) : super(key: key);
5+
6+
@override
7+
_CreatProfileState createState() => _CreatProfileState();
8+
}
9+
10+
class _CreatProfileState extends State<CreatProfile> {
11+
@override
12+
Widget build(BuildContext context) {
13+
return Scaffold(
14+
body: Padding(
15+
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
16+
child: ListView(
17+
children: <Widget>[
18+
inputField(),
19+
inputField(),
20+
inputField(),
21+
inputField(),
22+
],
23+
),
24+
),
25+
);
26+
}
27+
28+
Widget inputField() {
29+
return TextField(
30+
decoration: new InputDecoration(
31+
focusedBorder: OutlineInputBorder(
32+
borderSide: BorderSide(color: Colors.lightGreen, width: 2.0),
33+
),
34+
enabledBorder: OutlineInputBorder(
35+
borderSide: BorderSide(color: Colors.orange, width: 1.0),
36+
),
37+
hintText: 'Mobile Number',
38+
),
39+
);
40+
}
41+
}

lib/Profile/ProfileScreen.dart

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import 'package:blogapp/Profile/CreatProfile.dart';
2+
import 'package:flutter/material.dart';
3+
4+
class ProfileScreen extends StatefulWidget {
5+
ProfileScreen({Key key}) : super(key: key);
6+
7+
@override
8+
_ProfileScreenState createState() => _ProfileScreenState();
9+
}
10+
11+
class _ProfileScreenState extends State<ProfileScreen> {
12+
@override
13+
Widget build(BuildContext context) {
14+
return Scaffold(
15+
body: button(),
16+
);
17+
}
18+
19+
Widget button() {
20+
return Padding(
21+
padding: const EdgeInsets.symmetric(horizontal: 70),
22+
child: Column(
23+
mainAxisAlignment: MainAxisAlignment.center,
24+
crossAxisAlignment: CrossAxisAlignment.center,
25+
children: <Widget>[
26+
Text(
27+
"Tap to button to add profile data",
28+
textAlign: TextAlign.center,
29+
style: TextStyle(
30+
color: Colors.deepOrange,
31+
fontSize: 18,
32+
),
33+
),
34+
SizedBox(
35+
height: 30,
36+
),
37+
InkWell(
38+
onTap: () => {
39+
Navigator.push(context,
40+
MaterialPageRoute(builder: (context) => CreatProfile()))
41+
},
42+
child: Container(
43+
height: 60,
44+
width: 150,
45+
decoration: BoxDecoration(
46+
color: Colors.blueGrey,
47+
borderRadius: BorderRadius.circular(20),
48+
),
49+
child: Center(
50+
child: Text(
51+
"Add Proile",
52+
style: TextStyle(
53+
color: Colors.white,
54+
fontSize: 18,
55+
),
56+
),
57+
),
58+
),
59+
),
60+
],
61+
),
62+
);
63+
}
64+
}

lib/Screen/ProfileScreen.dart

Lines changed: 0 additions & 19 deletions
This file was deleted.

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class _MyAppState extends State<MyApp> {
2525

2626
void checkLogin() async {
2727
String token = await storage.read(key: "token");
28-
if (token == null) {
28+
if (token != null) {
2929
setState(() {
3030
page = HomePage();
3131
});

0 commit comments

Comments
 (0)