|
| 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 | +} |
0 commit comments