Skip to content

Commit 154aab4

Browse files
committed
Add edit expense screen
1 parent 5b6a067 commit 154aab4

File tree

2 files changed

+275
-1
lines changed

2 files changed

+275
-1
lines changed

lib/basic.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:basic/classes/size_units_class.dart';
22
import 'package:basic/constants/color_constants.dart';
33
import 'package:basic/constants/textstyle_constants.dart';
44
import 'package:basic/screens/edit/edit_customer_screen.dart';
5+
import 'package:basic/screens/edit/edit_expense_screen.dart';
56
import 'package:basic/screens/edit/edit_item_screen.dart';
67
import 'package:basic/screens/edit/edit_product_screen.dart';
78
import 'package:basic/screens/edit/edit_service1_screen.dart';
@@ -65,7 +66,7 @@ class Basic extends StatelessWidget {
6566
primaryColor: primaryColor,
6667
scaffoldBackgroundColor: desaturatedGreyColor,
6768
),
68-
home: NewCustomerScreen(),
69+
home: EditExpenseScreen(),
6970
debugShowCheckedModeBanner: false,
7071
);
7172
}
Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
import 'package:basic/constants/color_constants.dart';
2+
import 'package:basic/constants/textstyle_constants.dart';
3+
import 'package:basic/screens/edit/edit_service_screen.dart';
4+
import 'package:basic/screens/upload/upload_product_screen.dart';
5+
import 'package:flutter/material.dart';
6+
import 'package:flutter/services.dart';
7+
8+
class EditExpenseScreen extends StatelessWidget {
9+
const EditExpenseScreen({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: Row(
31+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
32+
children: [
33+
FittedBox(
34+
child: InkWell(
35+
onTap: () {
36+
Navigator.of(context).pop();
37+
},
38+
child: Container(
39+
padding: EdgeInsets.symmetric(
40+
vertical: 10,
41+
horizontal: 10,
42+
),
43+
decoration: BoxDecoration(
44+
color: lightWhiteColor,
45+
borderRadius: BorderRadius.all(Radius.circular(10))),
46+
child: Row(
47+
children: [
48+
Icon(
49+
Icons.arrow_back_ios,
50+
size: 17,
51+
),
52+
SizedBox(width: 15),
53+
Text(
54+
'Return',
55+
style: labelBoldTextStyle,
56+
),
57+
],
58+
),
59+
),
60+
),
61+
),
62+
FittedBox(
63+
child: InkWell(
64+
onTap: () {
65+
Navigator.of(context)
66+
.push(MaterialPageRoute(builder: (BuildContext ctx) {
67+
return UploadProductScreen();
68+
}));
69+
},
70+
child: Container(
71+
padding: EdgeInsets.symmetric(
72+
vertical: 10,
73+
horizontal: 10,
74+
),
75+
decoration: BoxDecoration(
76+
color: lightWhiteColor,
77+
borderRadius: BorderRadius.all(Radius.circular(10))),
78+
child: Row(
79+
children: [
80+
Image.asset('images/edit_icon.png'),
81+
SizedBox(width: 15),
82+
Text(
83+
'Edit',
84+
style: labelBoldTextStyle,
85+
),
86+
],
87+
),
88+
),
89+
),
90+
),
91+
],
92+
),
93+
automaticallyImplyLeading: false,
94+
bottom: PreferredSize(
95+
child: Container(
96+
margin: EdgeInsets.only(
97+
left: 20,
98+
bottom: 20,
99+
),
100+
child: Align(
101+
alignment: Alignment.topLeft,
102+
child: Text(
103+
'Crepes from Jim',
104+
style: h6TextStyle.merge(TextStyle(color: whiteColor)),
105+
),
106+
),
107+
),
108+
preferredSize: Size.fromHeight(60),
109+
),
110+
),
111+
body: SingleChildScrollView(
112+
child: Container(
113+
padding: EdgeInsets.all(20),
114+
child: Column(
115+
children: [
116+
Container(
117+
width: double.infinity,
118+
padding: EdgeInsets.symmetric(
119+
vertical: 20,
120+
horizontal: 20,
121+
),
122+
decoration: BoxDecoration(
123+
color: whiteColor,
124+
borderRadius: BorderRadius.all(Radius.circular(20)),
125+
),
126+
child: Text(
127+
'Product',
128+
style: bodyTextStyle,
129+
),
130+
),
131+
SizedBox(height: 10),
132+
Container(
133+
width: double.infinity,
134+
padding: EdgeInsets.symmetric(
135+
vertical: 20,
136+
horizontal: 20,
137+
),
138+
decoration: BoxDecoration(
139+
color: whiteColor,
140+
borderRadius: BorderRadius.all(Radius.circular(20)),
141+
),
142+
child: Text(
143+
'Jim',
144+
style: bodyTextStyle,
145+
),
146+
),
147+
SizedBox(height: 10),
148+
Container(
149+
decoration: BoxDecoration(
150+
borderRadius: BorderRadius.all(Radius.circular(20)),
151+
),
152+
clipBehavior: Clip.hardEdge,
153+
child: Column(
154+
children: [
155+
Row(
156+
children: [
157+
Expanded(
158+
child: Container(
159+
decoration: BoxDecoration(
160+
color: whiteColor,
161+
),
162+
padding: EdgeInsets.symmetric(
163+
vertical: 20,
164+
horizontal: 20,
165+
),
166+
child: Text(
167+
'Crepes',
168+
style: bodyTextStyle,
169+
),
170+
),
171+
),
172+
SizedBox(width: 1),
173+
Container(
174+
decoration: BoxDecoration(
175+
color: whiteColor,
176+
),
177+
padding: EdgeInsets.symmetric(
178+
vertical: 20,
179+
horizontal: 20,
180+
),
181+
child: Text(
182+
'08',
183+
style: bodyTextStyle,
184+
),
185+
),
186+
],
187+
),
188+
SizedBox(height: 1),
189+
Container(
190+
width: double.infinity,
191+
decoration: BoxDecoration(
192+
color: whiteColor,
193+
),
194+
padding: EdgeInsets.symmetric(
195+
vertical: 20,
196+
horizontal: 20,
197+
),
198+
child: Text(
199+
'XAF20,000',
200+
style: bodyTextStyle,
201+
),
202+
),
203+
],
204+
),
205+
),
206+
],
207+
),
208+
),
209+
),
210+
persistentFooterButtons: [
211+
Container(
212+
padding: EdgeInsets.all(10),
213+
color: desaturatedGreyColor,
214+
child: Column(
215+
children: [
216+
Row(
217+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
218+
children: [
219+
Text(
220+
'Subtotal (XAF): ',
221+
style: captionTextStyle
222+
.merge(TextStyle(color: lightGreyColor)),
223+
),
224+
Expanded(
225+
child: Text(
226+
'20,000',
227+
textAlign: TextAlign.end,
228+
style: captionTextStyle
229+
.merge(TextStyle(color: lightGreyColor)),
230+
),
231+
),
232+
],
233+
),
234+
SizedBox(height: 10),
235+
Row(
236+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
237+
children: [
238+
Text('Total (XAF): ', style: bodyBoldTextStyle),
239+
Expanded(
240+
child: Text('20,000',
241+
textAlign: TextAlign.end, style: bodyBoldTextStyle),
242+
),
243+
],
244+
),
245+
SizedBox(height: 20),
246+
InkWell(
247+
onTap: () {
248+
Navigator.of(context)
249+
.push(MaterialPageRoute(builder: (BuildContext ctx) {
250+
return EditServiceScreen();
251+
}));
252+
},
253+
child: Container(
254+
decoration: BoxDecoration(
255+
borderRadius: BorderRadius.all(Radius.circular(20)),
256+
color: lightRedColor,
257+
),
258+
width: double.infinity,
259+
padding: EdgeInsets.all(20),
260+
child: Text(
261+
'Delete expense',
262+
textAlign: TextAlign.center,
263+
style: bodyBoldTextStyle.merge(TextStyle(color: redColor)),
264+
),
265+
),
266+
),
267+
],
268+
),
269+
),
270+
],
271+
);
272+
}
273+
}

0 commit comments

Comments
 (0)