Skip to content

Commit 5b6a067

Browse files
committed
Add new customer screen
1 parent d87cc6d commit 5b6a067

File tree

2 files changed

+297
-1
lines changed

2 files changed

+297
-1
lines changed

lib/basic.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import 'package:basic/screens/auth/setup_account_screen.dart';
1313
import 'package:basic/screens/auth/verify_number_screen.dart';
1414
import 'package:basic/screens/dashboard/dashboard_screen.dart';
1515
import 'package:basic/screens/main/main_screen.dart';
16+
import 'package:basic/screens/new/new_customer_screen.dart';
1617
import 'package:basic/screens/new/new_item_screen.dart';
1718
import 'package:basic/screens/new/new_product_screen.dart';
1819
import 'package:basic/screens/new/new_service1_screen.dart';
@@ -64,7 +65,7 @@ class Basic extends StatelessWidget {
6465
primaryColor: primaryColor,
6566
scaffoldBackgroundColor: desaturatedGreyColor,
6667
),
67-
home: UploadCustomerScreen(),
68+
home: NewCustomerScreen(),
6869
debugShowCheckedModeBanner: false,
6970
);
7071
}
Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
import 'package:basic/Enums/button_size_enums.dart';
2+
import 'package:basic/constants/color_constants.dart';
3+
import 'package:basic/constants/textstyle_constants.dart';
4+
import 'package:basic/screens/edit/edit_service_screen.dart';
5+
import 'package:basic/screens/upload/upload_product_screen.dart';
6+
import 'package:basic/widgets/button_widget.dart';
7+
import 'package:flutter/material.dart';
8+
import 'package:flutter/services.dart';
9+
10+
class NewCustomerScreen extends StatelessWidget {
11+
const NewCustomerScreen({Key? key}) : super(key: key);
12+
13+
@override
14+
Widget build(BuildContext context) {
15+
SystemChrome.setEnabledSystemUIOverlays([
16+
SystemUiOverlay.top,
17+
SystemUiOverlay.bottom,
18+
]);
19+
20+
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
21+
statusBarColor: primaryColor,
22+
statusBarBrightness: Brightness.dark,
23+
systemNavigationBarIconBrightness: Brightness.dark,
24+
statusBarIconBrightness: Brightness.light,
25+
systemNavigationBarColor: desaturatedGreyColor,
26+
));
27+
28+
return Scaffold(
29+
appBar: AppBar(
30+
brightness: Brightness.dark,
31+
backgroundColor: primaryColor,
32+
title: FittedBox(
33+
child: InkWell(
34+
onTap: () {
35+
Navigator.of(context).pop();
36+
},
37+
child: Container(
38+
padding: EdgeInsets.symmetric(
39+
vertical: 10,
40+
horizontal: 10,
41+
),
42+
decoration: BoxDecoration(
43+
color: lightWhiteColor,
44+
borderRadius: BorderRadius.all(Radius.circular(10))),
45+
child: Row(
46+
children: [
47+
Icon(
48+
Icons.arrow_back_ios,
49+
size: 17,
50+
),
51+
SizedBox(width: 15),
52+
Text(
53+
'Return',
54+
style: labelBoldTextStyle,
55+
),
56+
],
57+
),
58+
),
59+
),
60+
),
61+
automaticallyImplyLeading: false,
62+
bottom: PreferredSize(
63+
child: Container(
64+
margin: EdgeInsets.only(
65+
left: 20,
66+
bottom: 20,
67+
),
68+
child: Align(
69+
alignment: Alignment.topLeft,
70+
child: Text(
71+
'Add a new customer',
72+
style: h6TextStyle.merge(TextStyle(color: whiteColor)),
73+
),
74+
),
75+
),
76+
preferredSize: Size.fromHeight(60),
77+
),
78+
),
79+
body: SingleChildScrollView(
80+
child: Container(
81+
padding: EdgeInsets.all(20),
82+
child: Column(
83+
children: [
84+
Container(
85+
padding: EdgeInsets.symmetric(
86+
vertical: 20,
87+
horizontal: 20,
88+
),
89+
height: 60,
90+
decoration: BoxDecoration(
91+
color: whiteColor,
92+
borderRadius: BorderRadius.all(
93+
Radius.circular(20),
94+
),
95+
),
96+
child: TextField(
97+
// maxLength: 3,
98+
keyboardType: TextInputType.number,
99+
decoration: InputDecoration(
100+
hintText: 'Name',
101+
hintStyle:
102+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
103+
contentPadding: EdgeInsets.symmetric(vertical: 8),
104+
enabledBorder: InputBorder.none,
105+
),
106+
),
107+
),
108+
SizedBox(height: 10),
109+
Container(
110+
padding: EdgeInsets.symmetric(
111+
vertical: 20,
112+
horizontal: 20,
113+
),
114+
height: 60,
115+
decoration: BoxDecoration(
116+
color: whiteColor,
117+
borderRadius: BorderRadius.all(
118+
Radius.circular(20),
119+
),
120+
),
121+
child: TextField(
122+
// maxLength: 3,
123+
keyboardType: TextInputType.number,
124+
decoration: InputDecoration(
125+
hintText: 'Phone number',
126+
hintStyle:
127+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
128+
contentPadding: EdgeInsets.symmetric(vertical: 8),
129+
enabledBorder: InputBorder.none,
130+
),
131+
),
132+
),
133+
SizedBox(height: 10),
134+
Container(
135+
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
136+
height: 60,
137+
decoration: BoxDecoration(
138+
color: whiteColor,
139+
borderRadius: BorderRadius.all(
140+
Radius.circular(20),
141+
),
142+
),
143+
child: SizedBox(
144+
width: double.infinity,
145+
child: DropdownButtonHideUnderline(
146+
child: DropdownButton(
147+
style:
148+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
149+
hint: Text(
150+
'Country',
151+
style:
152+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
153+
),
154+
onChanged: (String? t) {},
155+
icon: Padding(
156+
padding: const EdgeInsets.only(
157+
left: 10,
158+
bottom: 5,
159+
),
160+
child: RotatedBox(
161+
quarterTurns: 3,
162+
child: Icon(
163+
Icons.arrow_back_ios,
164+
size: 16,
165+
color: primaryColor,
166+
),
167+
),
168+
),
169+
items: [
170+
DropdownMenuItem(
171+
value: 'Buea',
172+
child: Text('Buea'),
173+
),
174+
],
175+
),
176+
),
177+
),
178+
),
179+
SizedBox(height: 10),
180+
Container(
181+
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
182+
height: 60,
183+
decoration: BoxDecoration(
184+
color: whiteColor,
185+
borderRadius: BorderRadius.all(
186+
Radius.circular(20),
187+
),
188+
),
189+
child: SizedBox(
190+
width: double.infinity,
191+
child: DropdownButtonHideUnderline(
192+
child: DropdownButton(
193+
style:
194+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
195+
hint: Text(
196+
'State',
197+
style:
198+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
199+
),
200+
onChanged: (String? t) {},
201+
icon: Padding(
202+
padding: const EdgeInsets.only(
203+
left: 10,
204+
bottom: 5,
205+
),
206+
child: RotatedBox(
207+
quarterTurns: 3,
208+
child: Icon(
209+
Icons.arrow_back_ios,
210+
size: 16,
211+
color: primaryColor,
212+
),
213+
),
214+
),
215+
items: [
216+
DropdownMenuItem(
217+
value: 'Buea',
218+
child: Text('Buea'),
219+
),
220+
],
221+
),
222+
),
223+
),
224+
),
225+
SizedBox(height: 10),
226+
Container(
227+
padding: EdgeInsets.symmetric(
228+
vertical: 20,
229+
horizontal: 20,
230+
),
231+
height: 60,
232+
decoration: BoxDecoration(
233+
color: whiteColor,
234+
borderRadius: BorderRadius.all(
235+
Radius.circular(20),
236+
),
237+
),
238+
child: TextField(
239+
// maxLength: 3,
240+
keyboardType: TextInputType.number,
241+
decoration: InputDecoration(
242+
hintText: 'City',
243+
hintStyle:
244+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
245+
contentPadding: EdgeInsets.symmetric(vertical: 8),
246+
enabledBorder: InputBorder.none,
247+
),
248+
),
249+
),
250+
SizedBox(height: 10),
251+
Container(
252+
padding: EdgeInsets.symmetric(
253+
vertical: 20,
254+
horizontal: 20,
255+
),
256+
height: 60,
257+
decoration: BoxDecoration(
258+
color: whiteColor,
259+
borderRadius: BorderRadius.all(
260+
Radius.circular(20),
261+
),
262+
),
263+
child: TextField(
264+
// maxLength: 3,
265+
keyboardType: TextInputType.number,
266+
decoration: InputDecoration(
267+
hintText: 'Address',
268+
hintStyle:
269+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
270+
contentPadding: EdgeInsets.symmetric(vertical: 8),
271+
enabledBorder: InputBorder.none,
272+
),
273+
),
274+
),
275+
SizedBox(height: 20),
276+
],
277+
),
278+
),
279+
),
280+
persistentFooterButtons: [
281+
Container(
282+
padding: EdgeInsets.all(10),
283+
color: desaturatedGreyColor,
284+
child: ButtonWidget(
285+
backgroundColor: accentColor!,
286+
loading: false,
287+
onTap: () {},
288+
size: ButtonSize.big,
289+
text: 'Save',
290+
textColor: whiteColor!,
291+
)),
292+
],
293+
);
294+
}
295+
}

0 commit comments

Comments
 (0)