Skip to content

Commit 0bf830b

Browse files
committed
Add edit for item screen
1 parent 3108453 commit 0bf830b

File tree

2 files changed

+183
-1
lines changed

2 files changed

+183
-1
lines changed

lib/basic.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:basic/classes/size_units_class.dart';
22
import 'package:basic/constants/color_constants.dart';
33
import 'package:basic/constants/textstyle_constants.dart';
4+
import 'package:basic/screens/edit/edit_item_screen.dart';
45
import 'package:basic/screens/edit/edit_product_screen.dart';
56
import 'package:basic/screens/edit/edit_service_screen.dart';
67
import 'package:basic/screens/auth/business_account.dart';
@@ -56,7 +57,7 @@ class Basic extends StatelessWidget {
5657
primaryColor: primaryColor,
5758
scaffoldBackgroundColor: desaturatedGreyColor,
5859
),
59-
home: SplashScreen(),
60+
home: EditItemScreen(),
6061
debugShowCheckedModeBanner: false,
6162
);
6263
}
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
import 'package:basic/Enums/button_size_enums.dart';
2+
import 'package:basic/classes/spacing_class.dart';
3+
import 'package:basic/constants/color_constants.dart';
4+
import 'package:basic/constants/textstyle_constants.dart';
5+
import 'package:basic/screens/edit/edit_service_screen.dart';
6+
import 'package:basic/screens/upload/upload_product_screen.dart';
7+
import 'package:basic/widgets/appbar_button_widget.dart';
8+
import 'package:basic/widgets/button_widget.dart';
9+
import 'package:flutter/material.dart';
10+
import 'package:flutter/services.dart';
11+
12+
class EditItemScreen extends StatelessWidget {
13+
const EditItemScreen({Key? key}) : super(key: key);
14+
15+
@override
16+
Widget build(BuildContext context) {
17+
SystemChrome.setEnabledSystemUIOverlays([
18+
SystemUiOverlay.top,
19+
SystemUiOverlay.bottom,
20+
]);
21+
22+
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
23+
statusBarColor: primaryColor,
24+
statusBarBrightness: Brightness.dark,
25+
systemNavigationBarIconBrightness: Brightness.dark,
26+
statusBarIconBrightness: Brightness.light,
27+
systemNavigationBarColor: desaturatedGreyColor,
28+
));
29+
30+
return Scaffold(
31+
appBar: AppBar(
32+
brightness: Brightness.dark,
33+
backgroundColor: primaryColor,
34+
title: Row(
35+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
36+
children: [
37+
AppBarButtonWidget(
38+
icon: Icon(
39+
Icons.arrow_back_ios,
40+
size: 17,
41+
),
42+
isIconSameSize: false,
43+
onTap: () {},
44+
size: ButtonSize.small,
45+
text: 'Return',
46+
),
47+
AppBarButtonWidget(
48+
icon: Image.asset('images/edit_icon.png'),
49+
isIconSameSize: true,
50+
onTap: () {},
51+
size: ButtonSize.small,
52+
text: 'Edit',
53+
),
54+
],
55+
),
56+
automaticallyImplyLeading: false,
57+
bottom: PreferredSize(
58+
child: Container(
59+
margin: EdgeInsets.only(
60+
left: 20,
61+
bottom: 20,
62+
),
63+
child: Align(
64+
alignment: Alignment.topLeft,
65+
child: Text(
66+
'Crepes au chocolat',
67+
style: h6TextStyle.merge(TextStyle(color: whiteColor)),
68+
),
69+
),
70+
),
71+
preferredSize: Size.fromHeight(60),
72+
),
73+
),
74+
body: SingleChildScrollView(
75+
child: Container(
76+
padding: EdgeInsets.all(20),
77+
child: Column(
78+
children: [
79+
Container(
80+
width: double.infinity,
81+
padding: EdgeInsets.symmetric(
82+
vertical: 20,
83+
horizontal: 20,
84+
),
85+
decoration: BoxDecoration(
86+
color: whiteColor,
87+
borderRadius: BorderRadius.all(Radius.circular(20)),
88+
),
89+
child: Text(
90+
'Product',
91+
style: bodyTextStyle,
92+
),
93+
),
94+
SizedBox(height: 10),
95+
Container(
96+
width: double.infinity,
97+
padding: EdgeInsets.symmetric(
98+
vertical: 20,
99+
horizontal: 20,
100+
),
101+
decoration: BoxDecoration(
102+
color: whiteColor,
103+
borderRadius: BorderRadius.all(Radius.circular(20)),
104+
),
105+
child: Text(
106+
'Crepes au chocolat',
107+
style: bodyTextStyle,
108+
),
109+
),
110+
SizedBox(height: 10),
111+
Row(
112+
children: [
113+
Expanded(
114+
child: Container(
115+
decoration: BoxDecoration(
116+
color: whiteColor,
117+
borderRadius: BorderRadius.all(Radius.circular(20)),
118+
),
119+
padding: EdgeInsets.symmetric(
120+
vertical: 20,
121+
horizontal: 20,
122+
),
123+
child: Text(
124+
'XAF1,000',
125+
style: bodyTextStyle,
126+
),
127+
),
128+
),
129+
SpacingClass.hrMedium,
130+
Container(
131+
decoration: BoxDecoration(
132+
color: whiteColor,
133+
borderRadius: BorderRadius.all(Radius.circular(20)),
134+
),
135+
padding: EdgeInsets.symmetric(
136+
vertical: 20,
137+
horizontal: 20,
138+
),
139+
child: Text(
140+
'20',
141+
style: bodyTextStyle,
142+
),
143+
),
144+
],
145+
),
146+
SizedBox(height: 10),
147+
Container(
148+
width: double.infinity,
149+
decoration: BoxDecoration(
150+
color: whiteColor,
151+
borderRadius: BorderRadius.all(Radius.circular(20)),
152+
),
153+
padding: EdgeInsets.symmetric(
154+
vertical: 20,
155+
horizontal: 20,
156+
),
157+
child: Text(
158+
'Description',
159+
style: bodyTextStyle.merge(TextStyle(color: lightGreyColor)),
160+
),
161+
),
162+
],
163+
),
164+
),
165+
),
166+
persistentFooterButtons: [
167+
Container(
168+
padding: EdgeInsets.all(10),
169+
color: desaturatedGreyColor,
170+
child: ButtonWidget(
171+
backgroundColor: lightRedColor!,
172+
loading: false,
173+
onTap: () {},
174+
size: ButtonSize.big,
175+
text: 'Delete product',
176+
textColor: redColor!,
177+
)),
178+
],
179+
);
180+
}
181+
}

0 commit comments

Comments
 (0)