Skip to content

Commit 90f24fa

Browse files
committed
Add new expense product screen
1 parent 1c2735e commit 90f24fa

File tree

1 file changed

+380
-0
lines changed

1 file changed

+380
-0
lines changed
Lines changed: 380 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,380 @@
1+
import 'package:basic/constants/color_constants.dart';
2+
import 'package:basic/constants/textstyle_constants.dart';
3+
import 'package:basic/screens/new/new_service_screen.dart';
4+
import 'package:basic/widgets/row_price_details_widget.dart';
5+
import 'package:flutter/material.dart';
6+
import 'package:flutter/services.dart';
7+
8+
class NewExpenseProductScreen extends StatelessWidget {
9+
const NewExpenseProductScreen({Key? key}) : super(key: key);
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
SystemChrome.setEnabledSystemUIOverlays([
14+
SystemUiOverlay.top,
15+
SystemUiOverlay.bottom,
16+
]);
17+
18+
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
19+
statusBarColor: primaryColor,
20+
statusBarBrightness: Brightness.dark,
21+
systemNavigationBarIconBrightness: Brightness.dark,
22+
statusBarIconBrightness: Brightness.light,
23+
systemNavigationBarColor: desaturatedGreyColor,
24+
));
25+
26+
return Scaffold(
27+
appBar: AppBar(
28+
brightness: Brightness.dark,
29+
backgroundColor: primaryColor,
30+
title: FittedBox(
31+
child: InkWell(
32+
onTap: () {
33+
Navigator.of(context).pop();
34+
},
35+
child: Container(
36+
padding: EdgeInsets.symmetric(
37+
vertical: 10,
38+
horizontal: 10,
39+
),
40+
decoration: BoxDecoration(
41+
color: lightWhiteColor,
42+
borderRadius: BorderRadius.all(Radius.circular(10))),
43+
child: Row(
44+
children: [
45+
Icon(
46+
Icons.arrow_back_ios,
47+
size: 17,
48+
),
49+
SizedBox(width: 15),
50+
Text(
51+
'Return',
52+
style: labelBoldTextStyle,
53+
),
54+
],
55+
),
56+
),
57+
),
58+
),
59+
automaticallyImplyLeading: false,
60+
bottom: PreferredSize(
61+
child: Container(
62+
margin: EdgeInsets.only(
63+
left: 20,
64+
bottom: 20,
65+
),
66+
child: Align(
67+
alignment: Alignment.topLeft,
68+
child: Text(
69+
'Add a new expense',
70+
style: h6TextStyle.merge(TextStyle(color: whiteColor)),
71+
),
72+
),
73+
),
74+
preferredSize: Size.fromHeight(60),
75+
),
76+
),
77+
body: SingleChildScrollView(
78+
child: Container(
79+
padding: EdgeInsets.all(20),
80+
child: Column(
81+
children: [
82+
Container(
83+
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
84+
height: 60,
85+
decoration: BoxDecoration(
86+
color: whiteColor,
87+
borderRadius: BorderRadius.all(
88+
Radius.circular(20),
89+
),
90+
),
91+
child: SizedBox(
92+
width: double.infinity,
93+
child: DropdownButtonHideUnderline(
94+
child: DropdownButton(
95+
style:
96+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
97+
hint: Text(
98+
'Product',
99+
style:
100+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
101+
),
102+
onChanged: (String? t) {},
103+
icon: Padding(
104+
padding: const EdgeInsets.only(
105+
left: 10,
106+
bottom: 5,
107+
),
108+
child: RotatedBox(
109+
quarterTurns: 3,
110+
child: Icon(
111+
Icons.arrow_back_ios,
112+
size: 16,
113+
color: primaryColor,
114+
),
115+
),
116+
),
117+
items: [
118+
DropdownMenuItem(
119+
value: 'Buea',
120+
child: Text('Buea'),
121+
),
122+
],
123+
),
124+
),
125+
),
126+
),
127+
SizedBox(height: 10),
128+
Container(
129+
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
130+
height: 60,
131+
decoration: BoxDecoration(
132+
color: whiteColor,
133+
borderRadius: BorderRadius.all(
134+
Radius.circular(20),
135+
),
136+
),
137+
child: SizedBox(
138+
width: double.infinity,
139+
child: DropdownButtonHideUnderline(
140+
child: DropdownButton(
141+
style:
142+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
143+
hint: Text(
144+
'Select customer',
145+
style:
146+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
147+
),
148+
onChanged: (String? t) {},
149+
icon: Padding(
150+
padding: const EdgeInsets.only(
151+
left: 10,
152+
bottom: 5,
153+
),
154+
child: RotatedBox(
155+
quarterTurns: 3,
156+
child: Icon(
157+
Icons.arrow_back_ios,
158+
size: 16,
159+
color: primaryColor,
160+
),
161+
),
162+
),
163+
items: [
164+
DropdownMenuItem(
165+
value: 'Buea',
166+
child: Text('Buea'),
167+
),
168+
],
169+
),
170+
),
171+
),
172+
),
173+
SizedBox(height: 10),
174+
Container(
175+
decoration: BoxDecoration(
176+
borderRadius: BorderRadius.all(Radius.circular(20)),
177+
),
178+
clipBehavior: Clip.hardEdge,
179+
child: Column(
180+
children: [
181+
Row(
182+
children: [
183+
Expanded(
184+
child: Container(
185+
padding: EdgeInsets.symmetric(
186+
vertical: 20, horizontal: 20),
187+
height: 60,
188+
decoration: BoxDecoration(
189+
color: whiteColor,
190+
),
191+
child: SizedBox(
192+
width: double.infinity,
193+
child: DropdownButtonHideUnderline(
194+
child: DropdownButton(
195+
style: bodyTextStyle
196+
.merge(TextStyle(color: primaryColor)),
197+
hint: Text(
198+
'Add a product',
199+
style: bodyTextStyle
200+
.merge(TextStyle(color: primaryColor)),
201+
),
202+
onChanged: (String? t) {},
203+
icon: Padding(
204+
padding: const EdgeInsets.only(
205+
left: 10,
206+
bottom: 5,
207+
),
208+
child: RotatedBox(
209+
quarterTurns: 3,
210+
child: Icon(
211+
Icons.arrow_back_ios,
212+
size: 16,
213+
color: primaryColor,
214+
),
215+
),
216+
),
217+
items: [
218+
DropdownMenuItem(
219+
value: 'Buea',
220+
child: Text('Buea'),
221+
),
222+
],
223+
),
224+
),
225+
),
226+
),
227+
),
228+
SizedBox(width: 1),
229+
Container(
230+
width: 80,
231+
padding: EdgeInsets.symmetric(
232+
vertical: 20,
233+
horizontal: 20,
234+
),
235+
height: 60,
236+
decoration: BoxDecoration(
237+
color: whiteColor,
238+
),
239+
child: TextField(
240+
// maxLength: 3,
241+
keyboardType: TextInputType.number,
242+
decoration: InputDecoration(
243+
hintText: '00',
244+
hintStyle: bodyTextStyle
245+
.merge(TextStyle(color: primaryColor)),
246+
contentPadding: EdgeInsets.symmetric(vertical: 8),
247+
enabledBorder: InputBorder.none,
248+
),
249+
),
250+
),
251+
],
252+
),
253+
SizedBox(height: 1),
254+
Container(
255+
padding: EdgeInsets.symmetric(
256+
vertical: 20,
257+
horizontal: 20,
258+
),
259+
height: 60,
260+
decoration: BoxDecoration(
261+
color: whiteColor,
262+
),
263+
child: TextField(
264+
keyboardType: TextInputType.number,
265+
decoration: InputDecoration(
266+
hintText: 'XAF0',
267+
hintStyle: bodyTextStyle
268+
.merge(TextStyle(color: lightGreyColor)),
269+
contentPadding: EdgeInsets.symmetric(vertical: 8),
270+
enabledBorder: InputBorder.none,
271+
),
272+
),
273+
),
274+
],
275+
),
276+
),
277+
SizedBox(height: 20),
278+
Row(
279+
children: [
280+
Expanded(
281+
child: InkWell(
282+
onTap: () {},
283+
child: Container(
284+
decoration: BoxDecoration(
285+
borderRadius: BorderRadius.all(Radius.circular(20)),
286+
color: lightAccentColor,
287+
),
288+
width: double.infinity,
289+
padding: EdgeInsets.all(20),
290+
child: Text(
291+
'Add a product',
292+
textAlign: TextAlign.center,
293+
style: bodyBoldTextStyle
294+
.merge(TextStyle(color: accentColor)),
295+
),
296+
),
297+
),
298+
),
299+
SizedBox(width: 10),
300+
Expanded(
301+
child: InkWell(
302+
onTap: () {},
303+
child: Container(
304+
decoration: BoxDecoration(
305+
borderRadius: BorderRadius.all(Radius.circular(20)),
306+
color: lightRedColor,
307+
),
308+
width: double.infinity,
309+
padding: EdgeInsets.symmetric(
310+
vertical: 20,
311+
horizontal: 5,
312+
),
313+
child: Text(
314+
'Remove a product',
315+
textAlign: TextAlign.center,
316+
style: bodyBoldTextStyle
317+
.merge(TextStyle(color: redColor)),
318+
),
319+
),
320+
),
321+
),
322+
],
323+
),
324+
],
325+
),
326+
),
327+
),
328+
persistentFooterButtons: [
329+
Container(
330+
padding: EdgeInsets.all(10),
331+
color: desaturatedGreyColor,
332+
child: Column(
333+
children: [
334+
RowPriceDetailsWidget(
335+
title: 'Subtotal (XAF): ',
336+
price: '0',
337+
titleTextStyle: captionTextStyle.merge(
338+
TextStyle(color: lightGreyColor),
339+
),
340+
priceTextStyle: captionTextStyle.merge(
341+
TextStyle(color: lightGreyColor),
342+
),
343+
),
344+
SizedBox(height: 10),
345+
RowPriceDetailsWidget(
346+
title: 'Total (XAF): ',
347+
price: '0',
348+
titleTextStyle: bodyBoldTextStyle,
349+
priceTextStyle: bodyBoldTextStyle,
350+
),
351+
SizedBox(height: 20),
352+
InkWell(
353+
onTap: () {
354+
Navigator.of(context)
355+
.push(MaterialPageRoute(builder: (BuildContext ctx) {
356+
return NewServiceScreen();
357+
}));
358+
},
359+
child: Container(
360+
decoration: BoxDecoration(
361+
borderRadius: BorderRadius.all(Radius.circular(20)),
362+
color: accentColor,
363+
),
364+
width: double.infinity,
365+
padding: EdgeInsets.all(20),
366+
child: Text(
367+
'Save',
368+
textAlign: TextAlign.center,
369+
style:
370+
bodyBoldTextStyle.merge(TextStyle(color: whiteColor)),
371+
),
372+
),
373+
),
374+
],
375+
),
376+
),
377+
],
378+
);
379+
}
380+
}

0 commit comments

Comments
 (0)