Skip to content

Commit e825616

Browse files
committed
Add all expense item screens
1 parent 53d59f1 commit e825616

File tree

5 files changed

+325
-6
lines changed

5 files changed

+325
-6
lines changed

lib/screens/edit/edit_expense_item_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:basic/constants/textstyle_constants.dart';
55
import 'package:basic/screens/edit/edit_service1_screen.dart';
66
import 'package:basic/screens/edit/edit_service_screen.dart';
77
import 'package:basic/screens/new/new_item_screen.dart';
8+
import 'package:basic/screens/upload/upload_expense_item_screen.dart';
89
import 'package:basic/screens/upload/upload_item_screen.dart';
910
import 'package:basic/screens/upload/upload_product_screen.dart';
1011
import 'package:basic/widgets/appbar_button_widget.dart';
@@ -55,7 +56,7 @@ class EditExpenseItemScreen extends StatelessWidget {
5556
onTap: () {
5657
Navigator.of(context)
5758
.push(MaterialPageRoute(builder: (BuildContext ctx) {
58-
return UploadItemScreen();
59+
return UploadExpenseItemScreen();
5960
}));
6061
},
6162
size: ButtonSize.small,
Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
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/new/new_service1_screen.dart';
5+
import 'package:basic/screens/new/new_service_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 NewExpenseItemScreen extends StatelessWidget {
11+
const NewExpenseItemScreen({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 item',
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(vertical: 20, horizontal: 20),
86+
height: 60,
87+
decoration: BoxDecoration(
88+
color: whiteColor,
89+
borderRadius: BorderRadius.all(
90+
Radius.circular(20),
91+
),
92+
),
93+
child: SizedBox(
94+
width: double.infinity,
95+
child: DropdownButtonHideUnderline(
96+
child: DropdownButton(
97+
style:
98+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
99+
hint: Text(
100+
'Product',
101+
style:
102+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
103+
),
104+
onChanged: (String? t) {},
105+
icon: Padding(
106+
padding: const EdgeInsets.only(
107+
left: 10,
108+
bottom: 5,
109+
),
110+
child: RotatedBox(
111+
quarterTurns: 3,
112+
child: Icon(
113+
Icons.arrow_back_ios,
114+
size: 16,
115+
color: primaryColor,
116+
),
117+
),
118+
),
119+
items: [
120+
DropdownMenuItem(
121+
value: 'Buea',
122+
child: Text('Buea'),
123+
),
124+
],
125+
),
126+
),
127+
),
128+
),
129+
SizedBox(height: 10),
130+
Row(
131+
children: [
132+
Radio(
133+
value: 1,
134+
groupValue: 1,
135+
onChanged: (int? t) {},
136+
),
137+
Text(
138+
'Automatically add to products in stock',
139+
style: labelBoldTextStyle,
140+
),
141+
],
142+
),
143+
SizedBox(height: 10),
144+
Container(
145+
padding: EdgeInsets.symmetric(
146+
vertical: 20,
147+
horizontal: 20,
148+
),
149+
height: 60,
150+
decoration: BoxDecoration(
151+
color: whiteColor,
152+
borderRadius: BorderRadius.all(
153+
Radius.circular(20),
154+
),
155+
),
156+
child: TextField(
157+
// maxLength: 3,
158+
keyboardType: TextInputType.number,
159+
decoration: InputDecoration(
160+
hintText: 'Product name',
161+
hintStyle:
162+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
163+
contentPadding: EdgeInsets.symmetric(vertical: 8),
164+
enabledBorder: InputBorder.none,
165+
),
166+
),
167+
),
168+
SizedBox(height: 10),
169+
Row(
170+
children: [
171+
Expanded(
172+
child: Container(
173+
padding: EdgeInsets.symmetric(
174+
vertical: 20,
175+
horizontal: 20,
176+
),
177+
height: 60,
178+
decoration: BoxDecoration(
179+
color: whiteColor,
180+
borderRadius: BorderRadius.all(
181+
Radius.circular(20),
182+
),
183+
),
184+
child: TextField(
185+
// maxLength: 3,
186+
keyboardType: TextInputType.number,
187+
decoration: InputDecoration(
188+
hintText: 'Unit price',
189+
hintStyle: bodyTextStyle
190+
.merge(TextStyle(color: primaryColor)),
191+
contentPadding: EdgeInsets.symmetric(vertical: 8),
192+
enabledBorder: InputBorder.none,
193+
),
194+
),
195+
),
196+
),
197+
SizedBox(width: 10),
198+
Container(
199+
width: 80,
200+
padding: EdgeInsets.symmetric(
201+
vertical: 20,
202+
horizontal: 20,
203+
),
204+
height: 60,
205+
decoration: BoxDecoration(
206+
color: whiteColor,
207+
borderRadius: BorderRadius.all(
208+
Radius.circular(20),
209+
),
210+
),
211+
child: TextField(
212+
// maxLength: 3,
213+
keyboardType: TextInputType.number,
214+
decoration: InputDecoration(
215+
hintText: 'Qty',
216+
hintStyle:
217+
bodyTextStyle.merge(TextStyle(color: primaryColor)),
218+
contentPadding: EdgeInsets.symmetric(vertical: 8),
219+
enabledBorder: InputBorder.none,
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: 'Selling price',
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: 10,
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+
keyboardType: TextInputType.number,
265+
minLines: 5,
266+
maxLines: 7,
267+
decoration: InputDecoration(
268+
hintText: 'Description',
269+
hintStyle:
270+
bodyTextStyle.merge(TextStyle(color: lightGreyColor)),
271+
contentPadding: EdgeInsets.symmetric(vertical: 8),
272+
enabledBorder: InputBorder.none,
273+
),
274+
),
275+
),
276+
SizedBox(height: 20),
277+
],
278+
),
279+
),
280+
),
281+
persistentFooterButtons: [
282+
Container(
283+
padding: EdgeInsets.all(10),
284+
color: desaturatedGreyColor,
285+
child: ButtonWidget(
286+
backgroundColor: accentColor!,
287+
loading: false,
288+
onTap: () {
289+
Navigator.of(context)
290+
.push(MaterialPageRoute(builder: (BuildContext ctx) {
291+
return NewService1Screen();
292+
}));
293+
},
294+
size: ButtonSize.big,
295+
text: 'Save',
296+
textColor: whiteColor!,
297+
)),
298+
],
299+
);
300+
}
301+
}

lib/screens/new/new_service1_screen.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ class NewService1Screen extends StatelessWidget {
173173
SizedBox(height: 10),
174174
Container(
175175
padding: EdgeInsets.symmetric(
176-
vertical: 20,
176+
vertical: 10,
177177
horizontal: 20,
178178
),
179-
height: 60,
179+
// height: 60,
180180
decoration: BoxDecoration(
181181
color: whiteColor,
182182
borderRadius: BorderRadius.all(
@@ -185,6 +185,8 @@ class NewService1Screen extends StatelessWidget {
185185
),
186186
child: TextField(
187187
keyboardType: TextInputType.number,
188+
minLines: 5,
189+
maxLines: 7,
188190
decoration: InputDecoration(
189191
hintText: 'Description',
190192
hintStyle:

lib/screens/purchases/purchases_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:basic/constants/color_constants.dart';
22
import 'package:basic/constants/textstyle_constants.dart';
33
import 'package:basic/screens/new/new_customer_screen.dart';
4+
import 'package:basic/screens/new/new_expense_item_screen.dart';
45
import 'package:basic/screens/new/new_expense_product_screen.dart';
56
import 'package:basic/screens/new/new_item_screen.dart';
67
import 'package:basic/screens/new/new_product_screen.dart';
@@ -128,7 +129,7 @@ class _PurchasesScreenState extends State<PurchasesScreen>
128129
Navigator.of(context)
129130
.push(MaterialPageRoute(builder: (BuildContext ctx) {
130131
if (_index == 0) return NewExpenseProductScreen();
131-
if (_index == 1) return NewItemScreen();
132+
if (_index == 1) return NewExpenseItemScreen();
132133
return NewCustomerScreen();
133134
}));
134135
},

lib/screens/upload/upload_expense_item_screen.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import 'package:basic/widgets/button_widget.dart';
55
import 'package:flutter/material.dart';
66
import 'package:flutter/services.dart';
77

8-
class UploadItemScreen extends StatelessWidget {
9-
const UploadItemScreen({Key? key}) : super(key: key);
8+
class UploadExpenseItemScreen extends StatelessWidget {
9+
const UploadExpenseItemScreen({Key? key}) : super(key: key);
1010

1111
@override
1212
Widget build(BuildContext context) {
@@ -125,6 +125,20 @@ class UploadItemScreen extends StatelessWidget {
125125
),
126126
),
127127
SizedBox(height: 10),
128+
Row(
129+
children: [
130+
Radio(
131+
value: 1,
132+
groupValue: 1,
133+
onChanged: (int? t) {},
134+
),
135+
Text(
136+
'Automatically add to products in stock',
137+
style: labelBoldTextStyle,
138+
),
139+
],
140+
),
141+
SizedBox(height: 10),
128142
Container(
129143
padding: EdgeInsets.symmetric(
130144
vertical: 20,

0 commit comments

Comments
 (0)