internal Work List screen
							parent
							
								
									ad1dd5370b
								
							
						
					
					
						commit
						88b86c66d5
					
				| @ -0,0 +1,126 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| import 'dart:math' as math; | ||||
| 
 | ||||
| class ActionsFragment extends StatelessWidget { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: double.infinity, | ||||
|       child: Column( | ||||
|         children: [ | ||||
|           showItem(), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget showItem() { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       decoration: BoxDecoration( | ||||
|         color: Colors.white, | ||||
|         borderRadius: BorderRadius.circular(15), | ||||
|         boxShadow: [ | ||||
|           BoxShadow( | ||||
|             color: const Color(0xff000000).withOpacity(.05), | ||||
|             blurRadius: 26, | ||||
|             offset: const Offset(0, -3), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|       clipBehavior: Clip.antiAlias, | ||||
|       margin: EdgeInsets.all(21), | ||||
|       child: Stack( | ||||
|         clipBehavior: Clip.antiAlias, | ||||
|         children: [ | ||||
|           Positioned( | ||||
|             left: -21, | ||||
|             child: Transform.rotate( | ||||
|               angle: 125, | ||||
|               child: Container( | ||||
|                 width: 60, | ||||
|                 height: 20, | ||||
|                 color: Colors.black, | ||||
|               ), | ||||
|             ), | ||||
|           ), | ||||
|           Column( | ||||
|             children: [ | ||||
|               Padding( | ||||
|                 padding: const EdgeInsets.only(left: 12, right: 12, top: 12), | ||||
|                 child: Column( | ||||
|                   children: [ | ||||
|                     Row( | ||||
|                       children: [ | ||||
|                         CircularAvatar(), | ||||
|                         12.width, | ||||
|                         Expanded( | ||||
|                           child: Column( | ||||
|                             crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                             children: [ | ||||
|                               "Mahmoud Shrouf".toText16(), | ||||
|                               6.height, | ||||
|                               "Missing Swipe Request for Hussain, Mohammad has been approved" | ||||
|                                   .toText12(), | ||||
|                               3.height, | ||||
|                               Row( | ||||
|                                 children: [ | ||||
|                                   "Submitted".toText10(), | ||||
|                                   12.width, | ||||
|                                   "On 07 Jan 2021" | ||||
|                                       .toText12(color: MyColors.lightTextColor) | ||||
|                                 ], | ||||
|                               ) | ||||
|                             ], | ||||
|                           ), | ||||
|                         ) | ||||
|                       ], | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|               12.height, | ||||
|               Container( | ||||
|                 width: double.infinity, | ||||
|                 height: 1, | ||||
|                 color: MyColors.lightTextColor, | ||||
|               ), | ||||
|               Row( | ||||
|                 children: [ | ||||
|                   Expanded( | ||||
|                     child: Center( | ||||
|                       child: "Request Info" | ||||
|                           .toText12(isBold: true) | ||||
|                           .paddingOnly(left: 21, right: 21, top: 16, bottom: 8), | ||||
|                     ), | ||||
|                   ), | ||||
|                   Center( | ||||
|                     child: Container( | ||||
|                       width: 1, | ||||
|                       height: 45, | ||||
|                       color: MyColors.lightTextColor, | ||||
|                     ), | ||||
|                   ), | ||||
|                   Expanded( | ||||
|                     child: Center( | ||||
|                       child: "Delegate" | ||||
|                           .toText12( | ||||
|                               color: MyColors.gradiantEndColor, isBold: true) | ||||
|                           .paddingOnly(left: 21, right: 21, top: 16, bottom: 8), | ||||
|                     ), | ||||
|                   ), | ||||
|                 ], | ||||
|               ), | ||||
|             ], | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,11 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| 
 | ||||
| class AttachmentsFragment extends StatelessWidget { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: double.infinity, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,11 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| 
 | ||||
| class InfoFragment extends StatelessWidget { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: double.infinity, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,87 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| 
 | ||||
| class RequestFragment extends StatefulWidget { | ||||
|   @override | ||||
|   State<RequestFragment> createState() => _RequestFragmentState(); | ||||
| } | ||||
| 
 | ||||
| class _RequestFragmentState extends State<RequestFragment> { | ||||
|   bool isOpened = false; | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: double.infinity, | ||||
|       child: Column( | ||||
|         children: [ | ||||
|           Container( | ||||
|             width: double.infinity, | ||||
|             decoration: BoxDecoration( | ||||
|               color: Colors.white, | ||||
|               borderRadius: BorderRadius.circular(15), | ||||
|               boxShadow: [ | ||||
|                 BoxShadow( | ||||
|                   color: const Color(0xff000000).withOpacity(.05), | ||||
|                   blurRadius: 26, | ||||
|                   offset: const Offset(0, -3), | ||||
|                 ), | ||||
|               ], | ||||
|             ), | ||||
|             margin: EdgeInsets.all(21), | ||||
|             padding: EdgeInsets.only(top: 21, bottom: 21, right: 16, left: 16), | ||||
|             child: Column( | ||||
|               children: [ | ||||
|                 Row( | ||||
|                   children: [ | ||||
|                     Expanded( | ||||
|                       child: "Hardware Mobility 161 Messenger".toText16(), | ||||
|                     ), | ||||
|                     Icon(Icons.keyboard_arrow_down_rounded), | ||||
|                   ], | ||||
|                 ), | ||||
|                 Column( | ||||
|                   children: [ | ||||
|                     12.height, | ||||
|                     showItem("Code:", "3188000067"), | ||||
|                     showItem("Quantity:", "1"), | ||||
|                     showItem("Line Status:", "Pending Approval"), | ||||
|                     showItem("Transection Type:", "Move Order Issue:"), | ||||
|                     showItem("Organization Code:", "SWD"), | ||||
|                     showItem("From Subinventory:", "SWD_MSPS"), | ||||
|                     showItem("To Subinventory:", "SWD_MSPS"), | ||||
|                     showItem("Ship To Location :", | ||||
|                         "SWD 11206-E.R. (Emergency Room)"), | ||||
|                     showItem("Unit:", "Each"), | ||||
|                     showItem("Date Required:", "12/23/2019 4:54:04 PM"), | ||||
|                     showItem("Status Date:", "12/23/2019 4:54:04 PM"), | ||||
|                     showItem("Operation Unit:", "Sehat Al Sewedi"), | ||||
|                     showItem("Organization:", "Sehat Al Sewedi"), | ||||
|                     showItem("From Locator:", "-"), | ||||
|                     showItem("To Locator :", "-"), | ||||
|                   ], | ||||
|                 ), | ||||
|               ], | ||||
|             ), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget showItem(String title, String value) { | ||||
|     return Padding( | ||||
|       padding: const EdgeInsets.only(top: 4, bottom: 4), | ||||
|       child: Row( | ||||
|         children: [ | ||||
|           title.toText12(isBold: true), | ||||
|           6.width, | ||||
|           title.toText12(isBold: false, color: MyColors.normalTextColor), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,105 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/ui/app_bar.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/actions_fragment.dart'; | ||||
| import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/attachments_fragment.dart'; | ||||
| import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/info_fragments.dart'; | ||||
| import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/request_fragment.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/app_button.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| 
 | ||||
| class MissingSwipeScreen extends StatelessWidget { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return DefaultTabController( | ||||
|       length: 4, | ||||
|       child: Scaffold( | ||||
|         appBar: appBar(context, title: "Missing Swipe Request"), | ||||
|         body: Container( | ||||
|           width: double.infinity, | ||||
|           height: double.infinity, | ||||
|           child: Column( | ||||
|             children: [ | ||||
|               Container( | ||||
|                 decoration: BoxDecoration( | ||||
|                   borderRadius: BorderRadius.only( | ||||
|                       bottomLeft: Radius.circular(20), | ||||
|                       bottomRight: Radius.circular(20)), | ||||
|                   gradient: LinearGradient( | ||||
|                       transform: GradientRotation(.46), | ||||
|                       begin: Alignment.topRight, | ||||
|                       end: Alignment.bottomRight, | ||||
|                       colors: [ | ||||
|                         MyColors.gradiantEndColor, | ||||
|                         MyColors.gradiantStartColor, | ||||
|                       ]), | ||||
|                 ), | ||||
|                 clipBehavior: Clip.antiAlias, | ||||
|                 child: TabBar( | ||||
|                   indicatorColor: Colors.white, | ||||
|                   labelColor: Colors.white, | ||||
|                   tabs: [ | ||||
|                     Tab( | ||||
|                       text: "Request", | ||||
|                     ), | ||||
|                     Tab( | ||||
|                       text: "Actions", | ||||
|                     ), | ||||
|                     Tab( | ||||
|                       text: "Attachments", | ||||
|                     ), | ||||
|                     Tab( | ||||
|                       text: "Info.", | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|               Expanded( | ||||
|                 child: TabBarView( | ||||
|                   children: [ | ||||
|                     RequestFragment(), | ||||
|                     ActionsFragment(), | ||||
|                     AttachmentsFragment(), | ||||
|                     InfoFragment(), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|               Container( | ||||
|                 width: double.infinity, | ||||
|                 height: 60, | ||||
|                 padding: EdgeInsets.only(left: 21, right: 21), | ||||
|                 child: Row( | ||||
|                   children: [ | ||||
|                     Expanded( | ||||
|                       child: DefaultButton( | ||||
|                         "Reject", | ||||
|                         () {}, | ||||
|                         colors: [ | ||||
|                           Color(0xffEB8C90), | ||||
|                           Color(0xffDE6C70), | ||||
|                         ], | ||||
|                       ), | ||||
|                     ), | ||||
|                     12.width, | ||||
|                     Expanded( | ||||
|                       child: DefaultButton( | ||||
|                         "Approve", | ||||
|                         () {}, | ||||
|                         colors: [ | ||||
|                           Color(0xff32D892), | ||||
|                           Color(0xff1AB170), | ||||
|                         ], | ||||
|                       ), | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ) | ||||
|             ], | ||||
|           ), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,96 @@ | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/theme/colors.dart'; | ||||
| 
 | ||||
| class AppButton extends StatefulWidget { | ||||
|   late AppButtonState _state; | ||||
| 
 | ||||
|   final String? text; | ||||
|   final double cornerRadius; | ||||
|   final EdgeInsets? margin; | ||||
|   final double? height; | ||||
|   final double? minWidth; | ||||
|   final VoidCallback? onClick; | ||||
|   final Color? color; | ||||
|   final Color? textColor; | ||||
|   final double fontSize; | ||||
|   final double elevation; | ||||
|   final bool bold; | ||||
| 
 | ||||
|   AppButton( | ||||
|       {this.text, | ||||
|       this.onClick, | ||||
|       this.cornerRadius = 10, | ||||
|       this.margin, | ||||
|       this.height, | ||||
|       this.color, | ||||
|       this.textColor, | ||||
|       this.minWidth, | ||||
|       this.fontSize = 15, | ||||
|       this.bold = true, | ||||
|       this.elevation = 5}); | ||||
| 
 | ||||
|   @override | ||||
|   State<StatefulWidget> createState() => _state = AppButtonState(); | ||||
| 
 | ||||
|   enable() { | ||||
|     _state.setState(() { | ||||
|       _state.enable = true; | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   disable() { | ||||
|     _state.setState(() { | ||||
|       _state.enable = false; | ||||
|     }); | ||||
|   } | ||||
| 
 | ||||
|   Color borderColor = Colors.transparent; | ||||
|   double borderWidth = 0; | ||||
|   BorderStyle borderStyle = BorderStyle.solid; | ||||
| 
 | ||||
|   AppButton border(Color color, double width, {BorderStyle? style}) { | ||||
|     borderColor = color; | ||||
|     borderStyle = style ?? BorderStyle.solid; | ||||
|     borderWidth = width; | ||||
|     return this; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class AppButtonState extends State<AppButton> { | ||||
|   bool enable = true; | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     var disableColor = | ||||
|         widget.color == null ? accentColor : widget.color!.withOpacity(0.2); | ||||
| 
 | ||||
|     // if(widget.bold) text.bold(); | ||||
|     // if(widget.fontSize != null) text.customSize(widget.fontSize); | ||||
| 
 | ||||
|     return Container( | ||||
|       height: widget.height ?? 60, | ||||
|       margin: widget.margin, | ||||
|       child: MaterialButton( | ||||
|         minWidth: widget.minWidth ?? 10, | ||||
|         elevation: widget.elevation, | ||||
|         onPressed: widget.onClick, | ||||
|         shape: RoundedRectangleBorder( | ||||
|             borderRadius: BorderRadius.circular(widget.cornerRadius), | ||||
|             side: BorderSide( | ||||
|                 style: widget.borderStyle, | ||||
|                 color: widget.borderColor, | ||||
|                 width: widget.borderWidth)), | ||||
|         disabledColor: disableColor, | ||||
|         color: widget.color ?? accentColor, | ||||
|         child: Text( | ||||
|           widget.text ?? "", | ||||
|           style: TextStyle( | ||||
|             fontSize: 16, | ||||
|             fontWeight: FontWeight.bold, | ||||
|           ), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue