|
| 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_service1_screen.dart'; |
| 6 | +import 'package:basic/screens/edit/edit_service_screen.dart'; |
| 7 | +import 'package:basic/screens/new/new_item_screen.dart'; |
| 8 | +import 'package:basic/screens/upload/upload_item_screen.dart'; |
| 9 | +import 'package:basic/screens/upload/upload_product_screen.dart'; |
| 10 | +import 'package:basic/widgets/appbar_button_widget.dart'; |
| 11 | +import 'package:basic/widgets/button_widget.dart'; |
| 12 | +import 'package:flutter/material.dart'; |
| 13 | +import 'package:flutter/services.dart'; |
| 14 | + |
| 15 | +class EditExpenseItemScreen extends StatelessWidget { |
| 16 | + const EditExpenseItemScreen({Key? key}) : super(key: key); |
| 17 | + |
| 18 | + @override |
| 19 | + Widget build(BuildContext context) { |
| 20 | + SystemChrome.setEnabledSystemUIOverlays([ |
| 21 | + SystemUiOverlay.top, |
| 22 | + SystemUiOverlay.bottom, |
| 23 | + ]); |
| 24 | + |
| 25 | + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( |
| 26 | + statusBarColor: primaryColor, |
| 27 | + statusBarBrightness: Brightness.dark, |
| 28 | + systemNavigationBarIconBrightness: Brightness.dark, |
| 29 | + statusBarIconBrightness: Brightness.light, |
| 30 | + systemNavigationBarColor: desaturatedGreyColor, |
| 31 | + )); |
| 32 | + |
| 33 | + return Scaffold( |
| 34 | + appBar: AppBar( |
| 35 | + brightness: Brightness.dark, |
| 36 | + backgroundColor: primaryColor, |
| 37 | + title: Row( |
| 38 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 39 | + children: [ |
| 40 | + AppBarButtonWidget( |
| 41 | + icon: Icon( |
| 42 | + Icons.arrow_back_ios, |
| 43 | + size: 17, |
| 44 | + ), |
| 45 | + isIconSameSize: false, |
| 46 | + onTap: () { |
| 47 | + Navigator.of(context).pop(); |
| 48 | + }, |
| 49 | + size: ButtonSize.small, |
| 50 | + text: 'Return', |
| 51 | + ), |
| 52 | + AppBarButtonWidget( |
| 53 | + icon: Image.asset('images/edit_icon.png'), |
| 54 | + isIconSameSize: true, |
| 55 | + onTap: () { |
| 56 | + Navigator.of(context) |
| 57 | + .push(MaterialPageRoute(builder: (BuildContext ctx) { |
| 58 | + return UploadItemScreen(); |
| 59 | + })); |
| 60 | + }, |
| 61 | + size: ButtonSize.small, |
| 62 | + text: 'Edit', |
| 63 | + ), |
| 64 | + ], |
| 65 | + ), |
| 66 | + automaticallyImplyLeading: false, |
| 67 | + bottom: PreferredSize( |
| 68 | + child: Container( |
| 69 | + margin: EdgeInsets.only( |
| 70 | + left: 20, |
| 71 | + bottom: 20, |
| 72 | + ), |
| 73 | + child: Align( |
| 74 | + alignment: Alignment.topLeft, |
| 75 | + child: Text( |
| 76 | + 'Crepes au chocolat', |
| 77 | + style: h6TextStyle.merge(TextStyle(color: whiteColor)), |
| 78 | + ), |
| 79 | + ), |
| 80 | + ), |
| 81 | + preferredSize: Size.fromHeight(60), |
| 82 | + ), |
| 83 | + ), |
| 84 | + body: SingleChildScrollView( |
| 85 | + child: Container( |
| 86 | + padding: EdgeInsets.all(20), |
| 87 | + child: Column( |
| 88 | + children: [ |
| 89 | + Container( |
| 90 | + width: double.infinity, |
| 91 | + padding: EdgeInsets.symmetric( |
| 92 | + vertical: 20, |
| 93 | + horizontal: 20, |
| 94 | + ), |
| 95 | + decoration: BoxDecoration( |
| 96 | + color: whiteColor, |
| 97 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 98 | + ), |
| 99 | + child: Text( |
| 100 | + 'Product', |
| 101 | + style: bodyTextStyle, |
| 102 | + ), |
| 103 | + ), |
| 104 | + SizedBox(height: 10), |
| 105 | + Row( |
| 106 | + children: [ |
| 107 | + Radio( |
| 108 | + value: 1, |
| 109 | + groupValue: 1, |
| 110 | + onChanged: (int? t) {}, |
| 111 | + ), |
| 112 | + Text( |
| 113 | + 'Automatically add to products in stock', |
| 114 | + style: labelBoldTextStyle, |
| 115 | + ), |
| 116 | + ], |
| 117 | + ), |
| 118 | + Container( |
| 119 | + width: double.infinity, |
| 120 | + padding: EdgeInsets.symmetric( |
| 121 | + vertical: 20, |
| 122 | + horizontal: 20, |
| 123 | + ), |
| 124 | + decoration: BoxDecoration( |
| 125 | + color: whiteColor, |
| 126 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 127 | + ), |
| 128 | + child: Text( |
| 129 | + 'Crepes au chocolat', |
| 130 | + style: bodyTextStyle, |
| 131 | + ), |
| 132 | + ), |
| 133 | + SizedBox(height: 10), |
| 134 | + Row( |
| 135 | + children: [ |
| 136 | + Expanded( |
| 137 | + child: Container( |
| 138 | + decoration: BoxDecoration( |
| 139 | + color: whiteColor, |
| 140 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 141 | + ), |
| 142 | + padding: EdgeInsets.symmetric( |
| 143 | + vertical: 20, |
| 144 | + horizontal: 20, |
| 145 | + ), |
| 146 | + child: Text( |
| 147 | + 'XAF1,000', |
| 148 | + style: bodyTextStyle, |
| 149 | + ), |
| 150 | + ), |
| 151 | + ), |
| 152 | + SpacingClass.hrMedium, |
| 153 | + Container( |
| 154 | + decoration: BoxDecoration( |
| 155 | + color: whiteColor, |
| 156 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 157 | + ), |
| 158 | + padding: EdgeInsets.symmetric( |
| 159 | + vertical: 20, |
| 160 | + horizontal: 20, |
| 161 | + ), |
| 162 | + child: Text( |
| 163 | + '20', |
| 164 | + style: bodyTextStyle, |
| 165 | + ), |
| 166 | + ), |
| 167 | + ], |
| 168 | + ), |
| 169 | + SizedBox(height: 10), |
| 170 | + Container( |
| 171 | + width: double.infinity, |
| 172 | + padding: EdgeInsets.symmetric( |
| 173 | + vertical: 20, |
| 174 | + horizontal: 20, |
| 175 | + ), |
| 176 | + decoration: BoxDecoration( |
| 177 | + color: whiteColor, |
| 178 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 179 | + ), |
| 180 | + child: Text( |
| 181 | + 'XAF2,000', |
| 182 | + style: bodyTextStyle, |
| 183 | + ), |
| 184 | + ), |
| 185 | + SizedBox(height: 10), |
| 186 | + Container( |
| 187 | + width: double.infinity, |
| 188 | + decoration: BoxDecoration( |
| 189 | + color: whiteColor, |
| 190 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 191 | + ), |
| 192 | + padding: EdgeInsets.symmetric( |
| 193 | + vertical: 20, |
| 194 | + horizontal: 20, |
| 195 | + ), |
| 196 | + child: Text( |
| 197 | + 'Description', |
| 198 | + style: bodyTextStyle.merge(TextStyle(color: lightGreyColor)), |
| 199 | + ), |
| 200 | + ), |
| 201 | + ], |
| 202 | + ), |
| 203 | + ), |
| 204 | + ), |
| 205 | + persistentFooterButtons: [ |
| 206 | + Container( |
| 207 | + padding: EdgeInsets.all(10), |
| 208 | + color: desaturatedGreyColor, |
| 209 | + child: ButtonWidget( |
| 210 | + backgroundColor: lightRedColor!, |
| 211 | + loading: false, |
| 212 | + onTap: () { |
| 213 | + Navigator.of(context) |
| 214 | + .push(MaterialPageRoute(builder: (BuildContext ctx) { |
| 215 | + return EditService1Screen(); |
| 216 | + })); |
| 217 | + }, |
| 218 | + size: ButtonSize.big, |
| 219 | + text: 'Delete product', |
| 220 | + textColor: redColor!, |
| 221 | + )), |
| 222 | + ], |
| 223 | + ); |
| 224 | + } |
| 225 | +} |
0 commit comments