|
| 1 | +import 'package:basic/constants/color_constants.dart'; |
| 2 | +import 'package:basic/constants/textstyle_constants.dart'; |
| 3 | +import 'package:basic/widgets/row_price_details_widget.dart'; |
| 4 | +import 'package:flutter/material.dart'; |
| 5 | +import 'package:flutter/services.dart'; |
| 6 | + |
| 7 | +class NewExpenseServiceScreen extends StatelessWidget { |
| 8 | + const NewExpenseServiceScreen({Key? key}) : super(key: key); |
| 9 | + |
| 10 | + @override |
| 11 | + Widget build(BuildContext context) { |
| 12 | + SystemChrome.setEnabledSystemUIOverlays([ |
| 13 | + SystemUiOverlay.top, |
| 14 | + SystemUiOverlay.bottom, |
| 15 | + ]); |
| 16 | + |
| 17 | + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( |
| 18 | + statusBarColor: primaryColor, |
| 19 | + statusBarBrightness: Brightness.dark, |
| 20 | + systemNavigationBarIconBrightness: Brightness.dark, |
| 21 | + statusBarIconBrightness: Brightness.light, |
| 22 | + systemNavigationBarColor: desaturatedGreyColor, |
| 23 | + )); |
| 24 | + |
| 25 | + return Scaffold( |
| 26 | + appBar: AppBar( |
| 27 | + brightness: Brightness.dark, |
| 28 | + backgroundColor: primaryColor, |
| 29 | + title: FittedBox( |
| 30 | + child: InkWell( |
| 31 | + onTap: () { |
| 32 | + Navigator.of(context).pop(); |
| 33 | + }, |
| 34 | + child: Container( |
| 35 | + padding: EdgeInsets.symmetric( |
| 36 | + vertical: 10, |
| 37 | + horizontal: 10, |
| 38 | + ), |
| 39 | + decoration: BoxDecoration( |
| 40 | + color: lightWhiteColor, |
| 41 | + borderRadius: BorderRadius.all(Radius.circular(10))), |
| 42 | + child: Row( |
| 43 | + children: [ |
| 44 | + Icon( |
| 45 | + Icons.arrow_back_ios, |
| 46 | + size: 17, |
| 47 | + ), |
| 48 | + SizedBox(width: 15), |
| 49 | + Text( |
| 50 | + 'Return', |
| 51 | + style: labelBoldTextStyle, |
| 52 | + ), |
| 53 | + ], |
| 54 | + ), |
| 55 | + ), |
| 56 | + ), |
| 57 | + ), |
| 58 | + automaticallyImplyLeading: false, |
| 59 | + bottom: PreferredSize( |
| 60 | + child: Container( |
| 61 | + margin: EdgeInsets.only( |
| 62 | + left: 20, |
| 63 | + bottom: 20, |
| 64 | + ), |
| 65 | + child: Align( |
| 66 | + alignment: Alignment.topLeft, |
| 67 | + child: Text( |
| 68 | + 'Add a new expense', |
| 69 | + style: h6TextStyle.merge(TextStyle(color: whiteColor)), |
| 70 | + ), |
| 71 | + ), |
| 72 | + ), |
| 73 | + preferredSize: Size.fromHeight(60), |
| 74 | + ), |
| 75 | + ), |
| 76 | + body: SingleChildScrollView( |
| 77 | + child: Container( |
| 78 | + padding: EdgeInsets.all(20), |
| 79 | + child: Column( |
| 80 | + children: [ |
| 81 | + Container( |
| 82 | + padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20), |
| 83 | + height: 60, |
| 84 | + decoration: BoxDecoration( |
| 85 | + color: whiteColor, |
| 86 | + borderRadius: BorderRadius.all( |
| 87 | + Radius.circular(20), |
| 88 | + ), |
| 89 | + ), |
| 90 | + child: SizedBox( |
| 91 | + width: double.infinity, |
| 92 | + child: DropdownButtonHideUnderline( |
| 93 | + child: DropdownButton( |
| 94 | + style: |
| 95 | + bodyTextStyle.merge(TextStyle(color: primaryColor)), |
| 96 | + hint: Text( |
| 97 | + 'Service', |
| 98 | + style: |
| 99 | + bodyTextStyle.merge(TextStyle(color: primaryColor)), |
| 100 | + ), |
| 101 | + onChanged: (String? t) {}, |
| 102 | + icon: Padding( |
| 103 | + padding: const EdgeInsets.only( |
| 104 | + left: 10, |
| 105 | + bottom: 5, |
| 106 | + ), |
| 107 | + child: RotatedBox( |
| 108 | + quarterTurns: 3, |
| 109 | + child: Icon( |
| 110 | + Icons.arrow_back_ios, |
| 111 | + size: 16, |
| 112 | + color: primaryColor, |
| 113 | + ), |
| 114 | + ), |
| 115 | + ), |
| 116 | + items: [ |
| 117 | + DropdownMenuItem( |
| 118 | + value: 'Buea', |
| 119 | + child: Text('Buea'), |
| 120 | + ), |
| 121 | + ], |
| 122 | + ), |
| 123 | + ), |
| 124 | + ), |
| 125 | + ), |
| 126 | + SizedBox(height: 10), |
| 127 | + Container( |
| 128 | + padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20), |
| 129 | + height: 60, |
| 130 | + decoration: BoxDecoration( |
| 131 | + color: whiteColor, |
| 132 | + borderRadius: BorderRadius.all( |
| 133 | + Radius.circular(20), |
| 134 | + ), |
| 135 | + ), |
| 136 | + child: SizedBox( |
| 137 | + width: double.infinity, |
| 138 | + child: DropdownButtonHideUnderline( |
| 139 | + child: DropdownButton( |
| 140 | + style: |
| 141 | + bodyTextStyle.merge(TextStyle(color: primaryColor)), |
| 142 | + hint: Text( |
| 143 | + 'Select supplier', |
| 144 | + style: |
| 145 | + bodyTextStyle.merge(TextStyle(color: primaryColor)), |
| 146 | + ), |
| 147 | + onChanged: (String? t) {}, |
| 148 | + icon: Padding( |
| 149 | + padding: const EdgeInsets.only( |
| 150 | + left: 10, |
| 151 | + bottom: 5, |
| 152 | + ), |
| 153 | + child: RotatedBox( |
| 154 | + quarterTurns: 3, |
| 155 | + child: Icon( |
| 156 | + Icons.arrow_back_ios, |
| 157 | + size: 16, |
| 158 | + color: primaryColor, |
| 159 | + ), |
| 160 | + ), |
| 161 | + ), |
| 162 | + items: [ |
| 163 | + DropdownMenuItem( |
| 164 | + value: 'Buea', |
| 165 | + child: Text('Buea'), |
| 166 | + ), |
| 167 | + ], |
| 168 | + ), |
| 169 | + ), |
| 170 | + ), |
| 171 | + ), |
| 172 | + SizedBox(height: 10), |
| 173 | + Container( |
| 174 | + decoration: BoxDecoration( |
| 175 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 176 | + ), |
| 177 | + clipBehavior: Clip.hardEdge, |
| 178 | + child: Column( |
| 179 | + children: [ |
| 180 | + Container( |
| 181 | + padding: |
| 182 | + EdgeInsets.symmetric(vertical: 20, horizontal: 20), |
| 183 | + height: 60, |
| 184 | + decoration: BoxDecoration( |
| 185 | + color: whiteColor, |
| 186 | + ), |
| 187 | + child: SizedBox( |
| 188 | + width: double.infinity, |
| 189 | + child: DropdownButtonHideUnderline( |
| 190 | + child: DropdownButton( |
| 191 | + style: bodyTextStyle |
| 192 | + .merge(TextStyle(color: primaryColor)), |
| 193 | + hint: Text( |
| 194 | + 'Add a new service', |
| 195 | + style: bodyTextStyle |
| 196 | + .merge(TextStyle(color: primaryColor)), |
| 197 | + ), |
| 198 | + onChanged: (String? t) {}, |
| 199 | + icon: Padding( |
| 200 | + padding: const EdgeInsets.only( |
| 201 | + left: 10, |
| 202 | + bottom: 5, |
| 203 | + ), |
| 204 | + child: RotatedBox( |
| 205 | + quarterTurns: 3, |
| 206 | + child: Icon( |
| 207 | + Icons.arrow_back_ios, |
| 208 | + size: 16, |
| 209 | + color: primaryColor, |
| 210 | + ), |
| 211 | + ), |
| 212 | + ), |
| 213 | + items: [ |
| 214 | + DropdownMenuItem( |
| 215 | + value: 'Buea', |
| 216 | + child: Text('Buea'), |
| 217 | + ), |
| 218 | + ], |
| 219 | + ), |
| 220 | + ), |
| 221 | + ), |
| 222 | + ), |
| 223 | + SizedBox(height: 1), |
| 224 | + Container( |
| 225 | + padding: EdgeInsets.symmetric( |
| 226 | + vertical: 20, |
| 227 | + horizontal: 20, |
| 228 | + ), |
| 229 | + height: 60, |
| 230 | + decoration: BoxDecoration( |
| 231 | + color: whiteColor, |
| 232 | + ), |
| 233 | + child: TextField( |
| 234 | + keyboardType: TextInputType.number, |
| 235 | + decoration: InputDecoration( |
| 236 | + hintText: 'Enter your pricing', |
| 237 | + hintStyle: bodyTextStyle |
| 238 | + .merge(TextStyle(color: primaryColor)), |
| 239 | + contentPadding: EdgeInsets.symmetric(vertical: 8), |
| 240 | + enabledBorder: InputBorder.none, |
| 241 | + ), |
| 242 | + ), |
| 243 | + ), |
| 244 | + ], |
| 245 | + ), |
| 246 | + ), |
| 247 | + SizedBox(height: 20), |
| 248 | + Row( |
| 249 | + children: [ |
| 250 | + Expanded( |
| 251 | + child: InkWell( |
| 252 | + onTap: () {}, |
| 253 | + child: Container( |
| 254 | + decoration: BoxDecoration( |
| 255 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 256 | + color: lightAccentColor, |
| 257 | + ), |
| 258 | + width: double.infinity, |
| 259 | + padding: EdgeInsets.all(20), |
| 260 | + child: Text( |
| 261 | + 'Add a service', |
| 262 | + textAlign: TextAlign.center, |
| 263 | + style: bodyBoldTextStyle |
| 264 | + .merge(TextStyle(color: accentColor)), |
| 265 | + ), |
| 266 | + ), |
| 267 | + ), |
| 268 | + ), |
| 269 | + SizedBox(width: 10), |
| 270 | + Expanded( |
| 271 | + child: InkWell( |
| 272 | + onTap: () {}, |
| 273 | + child: Container( |
| 274 | + decoration: BoxDecoration( |
| 275 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 276 | + color: lightRedColor, |
| 277 | + ), |
| 278 | + width: double.infinity, |
| 279 | + padding: EdgeInsets.symmetric( |
| 280 | + vertical: 20, |
| 281 | + horizontal: 5, |
| 282 | + ), |
| 283 | + child: Text( |
| 284 | + 'Remove a service', |
| 285 | + textAlign: TextAlign.center, |
| 286 | + style: bodyBoldTextStyle |
| 287 | + .merge(TextStyle(color: redColor)), |
| 288 | + ), |
| 289 | + ), |
| 290 | + ), |
| 291 | + ), |
| 292 | + ], |
| 293 | + ), |
| 294 | + ], |
| 295 | + ), |
| 296 | + ), |
| 297 | + ), |
| 298 | + persistentFooterButtons: [ |
| 299 | + Container( |
| 300 | + padding: EdgeInsets.all(10), |
| 301 | + color: desaturatedGreyColor, |
| 302 | + child: Column( |
| 303 | + children: [ |
| 304 | + RowPriceDetailsWidget( |
| 305 | + title: 'Subtotal (XAF): ', |
| 306 | + price: '0', |
| 307 | + titleTextStyle: captionTextStyle.merge( |
| 308 | + TextStyle(color: lightGreyColor), |
| 309 | + ), |
| 310 | + priceTextStyle: captionTextStyle.merge( |
| 311 | + TextStyle(color: lightGreyColor), |
| 312 | + ), |
| 313 | + ), |
| 314 | + SizedBox(height: 10), |
| 315 | + RowPriceDetailsWidget( |
| 316 | + title: 'Total (XAF): ', |
| 317 | + price: '0', |
| 318 | + titleTextStyle: bodyBoldTextStyle, |
| 319 | + priceTextStyle: bodyBoldTextStyle, |
| 320 | + ), |
| 321 | + SizedBox(height: 20), |
| 322 | + InkWell( |
| 323 | + onTap: () {}, |
| 324 | + child: Container( |
| 325 | + decoration: BoxDecoration( |
| 326 | + borderRadius: BorderRadius.all(Radius.circular(20)), |
| 327 | + color: accentColor, |
| 328 | + ), |
| 329 | + width: double.infinity, |
| 330 | + padding: EdgeInsets.all(20), |
| 331 | + child: Text( |
| 332 | + 'Save', |
| 333 | + textAlign: TextAlign.center, |
| 334 | + style: |
| 335 | + bodyBoldTextStyle.merge(TextStyle(color: whiteColor)), |
| 336 | + ), |
| 337 | + ), |
| 338 | + ), |
| 339 | + ], |
| 340 | + ), |
| 341 | + ), |
| 342 | + ], |
| 343 | + ); |
| 344 | + } |
| 345 | +} |
0 commit comments