Skip to content

Commit d2dae9c

Browse files
committed
tutorial 8 (Creating Admin Section)
1 parent 1f9bf62 commit d2dae9c

13 files changed

+610
-182
lines changed

.idea/workspace.xml

Lines changed: 178 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter_girlies_store.iml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/firebase_storage/example/.dart_tool" />
4040
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/firebase_storage/example/.pub" />
4141
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/firebase_storage/example/build" />
42+
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/shared_preferences/.dart_tool" />
43+
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/shared_preferences/.pub" />
44+
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/shared_preferences/build" />
45+
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/shared_preferences/example/.dart_tool" />
46+
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/shared_preferences/example/.pub" />
47+
<excludeFolder url="file://$MODULE_DIR$/ios/.symlinks/plugins/shared_preferences/example/build" />
4248
</content>
4349
<orderEntry type="sourceFolder" forTests="false" />
4450
<orderEntry type="library" name="Dart SDK" level="project" />

lib/adminScreens/add_products.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter/material.dart';
2+
3+
class AddProducts extends StatefulWidget {
4+
@override
5+
_AddProductsState createState() => _AddProductsState();
6+
}
7+
8+
class _AddProductsState extends State<AddProducts> {
9+
@override
10+
Widget build(BuildContext context) {
11+
return new Scaffold(
12+
appBar: new AppBar(
13+
title: new Text("Add Products"),
14+
centerTitle: false,
15+
),
16+
body: new Center(
17+
child: new Text(
18+
"Add Products",
19+
style: new TextStyle(fontSize: 25.0),
20+
),
21+
),
22+
);
23+
}
24+
}

lib/adminScreens/admin_home.dart

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter/cupertino.dart';
3+
import 'package:flutter_girlies_store/adminScreens/add_products.dart';
4+
import 'package:flutter_girlies_store/adminScreens/app_messages.dart';
5+
import 'package:flutter_girlies_store/adminScreens/app_orders.dart';
6+
import 'package:flutter_girlies_store/adminScreens/app_products.dart';
7+
import 'package:flutter_girlies_store/adminScreens/app_users.dart';
8+
import 'package:flutter_girlies_store/adminScreens/order_history.dart';
9+
import 'package:flutter_girlies_store/adminScreens/privilages.dart';
10+
import 'package:flutter_girlies_store/adminScreens/search_data.dart';
11+
12+
class AdminHome extends StatefulWidget {
13+
@override
14+
_AdminHomeState createState() => _AdminHomeState();
15+
}
16+
17+
class _AdminHomeState extends State<AdminHome> {
18+
Size screenSize;
19+
@override
20+
Widget build(BuildContext context) {
21+
screenSize = MediaQuery.of(context).size;
22+
return Scaffold(
23+
backgroundColor: Theme.of(context).primaryColor,
24+
appBar: new AppBar(
25+
title: new Text("App Admin"),
26+
centerTitle: true,
27+
elevation: 0.0,
28+
),
29+
//drawer: new Drawer(),
30+
body: SingleChildScrollView(
31+
padding: const EdgeInsets.all(8.0),
32+
child: new Column(
33+
children: <Widget>[
34+
new SizedBox(
35+
height: 20.0,
36+
),
37+
new Row(
38+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
39+
children: <Widget>[
40+
new GestureDetector(
41+
onTap: () {
42+
Navigator.of(context).push(new CupertinoPageRoute(
43+
builder: (context) => SearchData()));
44+
},
45+
child: new CircleAvatar(
46+
maxRadius: 70.0,
47+
child: Column(
48+
mainAxisAlignment: MainAxisAlignment.center,
49+
children: <Widget>[
50+
new Icon(Icons.search),
51+
new SizedBox(
52+
height: 10.0,
53+
),
54+
new Text("Search Data"),
55+
],
56+
),
57+
),
58+
),
59+
new GestureDetector(
60+
onTap: () {
61+
Navigator.of(context).push(new CupertinoPageRoute(
62+
builder: (context) => AppUsers()));
63+
},
64+
child: new CircleAvatar(
65+
maxRadius: 70.0,
66+
child: Column(
67+
mainAxisAlignment: MainAxisAlignment.center,
68+
children: <Widget>[
69+
new Icon(Icons.person),
70+
new SizedBox(
71+
height: 10.0,
72+
),
73+
new Text("App Users"),
74+
],
75+
),
76+
),
77+
),
78+
],
79+
),
80+
new SizedBox(
81+
height: 20.0,
82+
),
83+
new Row(
84+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
85+
children: <Widget>[
86+
new GestureDetector(
87+
onTap: () {
88+
Navigator.of(context).push(new CupertinoPageRoute(
89+
builder: (context) => AppOrders()));
90+
},
91+
child: new CircleAvatar(
92+
maxRadius: 70.0,
93+
child: Column(
94+
mainAxisAlignment: MainAxisAlignment.center,
95+
children: <Widget>[
96+
new Icon(Icons.notifications),
97+
new SizedBox(
98+
height: 10.0,
99+
),
100+
new Text("App Orders"),
101+
],
102+
),
103+
),
104+
),
105+
GestureDetector(
106+
onTap: () {
107+
Navigator.of(context).push(new CupertinoPageRoute(
108+
builder: (context) => AppMessages()));
109+
},
110+
child: new CircleAvatar(
111+
maxRadius: 70.0,
112+
child: Column(
113+
mainAxisAlignment: MainAxisAlignment.center,
114+
children: <Widget>[
115+
new Icon(Icons.chat),
116+
new SizedBox(
117+
height: 10.0,
118+
),
119+
new Text("App Messages"),
120+
],
121+
),
122+
),
123+
),
124+
],
125+
),
126+
new SizedBox(
127+
height: 20.0,
128+
),
129+
new Row(
130+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
131+
children: <Widget>[
132+
GestureDetector(
133+
onTap: () {
134+
Navigator.of(context).push(new CupertinoPageRoute(
135+
builder: (context) => AppProducts()));
136+
},
137+
child: new CircleAvatar(
138+
maxRadius: 70.0,
139+
child: Column(
140+
mainAxisAlignment: MainAxisAlignment.center,
141+
children: <Widget>[
142+
new Icon(Icons.shop),
143+
new SizedBox(
144+
height: 10.0,
145+
),
146+
new Text("App Products"),
147+
],
148+
),
149+
),
150+
),
151+
GestureDetector(
152+
onTap: () {
153+
Navigator.of(context).push(new CupertinoPageRoute(
154+
builder: (context) => AddProducts()));
155+
},
156+
child: new CircleAvatar(
157+
maxRadius: 70.0,
158+
child: Column(
159+
mainAxisAlignment: MainAxisAlignment.center,
160+
children: <Widget>[
161+
new Icon(Icons.add),
162+
new SizedBox(
163+
height: 10.0,
164+
),
165+
new Text("Add Products"),
166+
],
167+
),
168+
),
169+
),
170+
],
171+
),
172+
new SizedBox(
173+
height: 20.0,
174+
),
175+
new Row(
176+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
177+
children: <Widget>[
178+
GestureDetector(
179+
onTap: () {
180+
Navigator.of(context).push(new CupertinoPageRoute(
181+
builder: (context) => OrderHistory()));
182+
},
183+
child: new CircleAvatar(
184+
maxRadius: 70.0,
185+
child: Column(
186+
mainAxisAlignment: MainAxisAlignment.center,
187+
children: <Widget>[
188+
new Icon(Icons.history),
189+
new SizedBox(
190+
height: 10.0,
191+
),
192+
new Text("Order History"),
193+
],
194+
),
195+
),
196+
),
197+
GestureDetector(
198+
onTap: () {
199+
Navigator.of(context).push(new CupertinoPageRoute(
200+
builder: (context) => Privilages()));
201+
},
202+
child: new CircleAvatar(
203+
maxRadius: 70.0,
204+
child: Column(
205+
mainAxisAlignment: MainAxisAlignment.center,
206+
children: <Widget>[
207+
new Icon(Icons.person),
208+
new SizedBox(
209+
height: 10.0,
210+
),
211+
new Text("Privilages"),
212+
],
213+
),
214+
),
215+
),
216+
],
217+
)
218+
],
219+
),
220+
),
221+
);
222+
}
223+
}

lib/adminScreens/app_messages.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter/material.dart';
2+
3+
class AppMessages extends StatefulWidget {
4+
@override
5+
_AppMessagesState createState() => _AppMessagesState();
6+
}
7+
8+
class _AppMessagesState extends State<AppMessages> {
9+
@override
10+
Widget build(BuildContext context) {
11+
return new Scaffold(
12+
appBar: new AppBar(
13+
title: new Text("App Messages"),
14+
centerTitle: false,
15+
),
16+
body: new Center(
17+
child: new Text(
18+
"App Messages",
19+
style: new TextStyle(fontSize: 25.0),
20+
),
21+
),
22+
);
23+
}
24+
}

lib/adminScreens/app_orders.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter/material.dart';
2+
3+
class AppOrders extends StatefulWidget {
4+
@override
5+
_AppOrdersState createState() => _AppOrdersState();
6+
}
7+
8+
class _AppOrdersState extends State<AppOrders> {
9+
@override
10+
Widget build(BuildContext context) {
11+
return new Scaffold(
12+
appBar: new AppBar(
13+
title: new Text("App Orders"),
14+
centerTitle: false,
15+
),
16+
body: new Center(
17+
child: new Text(
18+
"App Orders",
19+
style: new TextStyle(fontSize: 25.0),
20+
),
21+
),
22+
);
23+
}
24+
}

lib/adminScreens/app_products.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter/material.dart';
2+
3+
class AppProducts extends StatefulWidget {
4+
@override
5+
_AppProductsState createState() => _AppProductsState();
6+
}
7+
8+
class _AppProductsState extends State<AppProducts> {
9+
@override
10+
Widget build(BuildContext context) {
11+
return new Scaffold(
12+
appBar: new AppBar(
13+
title: new Text("App Products"),
14+
centerTitle: false,
15+
),
16+
body: new Center(
17+
child: new Text(
18+
"App Products",
19+
style: new TextStyle(fontSize: 25.0),
20+
),
21+
),
22+
);
23+
}
24+
}

lib/adminScreens/app_users.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter/material.dart';
2+
3+
class AppUsers extends StatefulWidget {
4+
@override
5+
_AppUsersState createState() => _AppUsersState();
6+
}
7+
8+
class _AppUsersState extends State<AppUsers> {
9+
@override
10+
Widget build(BuildContext context) {
11+
return new Scaffold(
12+
appBar: new AppBar(
13+
title: new Text("App Users"),
14+
centerTitle: false,
15+
),
16+
body: new Center(
17+
child: new Text(
18+
"App Users",
19+
style: new TextStyle(fontSize: 25.0),
20+
),
21+
),
22+
);
23+
}
24+
}

lib/adminScreens/order_history.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import 'package:flutter/material.dart';
2+
3+
class OrderHistory extends StatefulWidget {
4+
@override
5+
_OrderHistoryState createState() => _OrderHistoryState();
6+
}
7+
8+
class _OrderHistoryState extends State<OrderHistory> {
9+
@override
10+
Widget build(BuildContext context) {
11+
return new Scaffold(
12+
appBar: new AppBar(
13+
title: new Text("Order History"),
14+
centerTitle: false,
15+
),
16+
body: new Center(
17+
child: new Text(
18+
"Order History",
19+
style: new TextStyle(fontSize: 25.0),
20+
),
21+
),
22+
);
23+
}
24+
}

0 commit comments

Comments
 (0)