Request and Delegate sheets
							parent
							
								
									1e9416c992
								
							
						
					
					
						commit
						22a9b3e818
					
				| @ -0,0 +1,165 @@ | ||||
| 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'; | ||||
| import 'package:mohem_flutter_app/ui/work_list/sheets/selected_item_sheet.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/input_widget.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/radio/show_radio.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| 
 | ||||
| class DelegateSheet extends StatelessWidget { | ||||
|   TextEditingController username = TextEditingController(); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     List<String> related = [ | ||||
|       "Amjad Khan", | ||||
|       "Munahi Nasser", | ||||
|     ]; | ||||
|     List<String> favorites = [ | ||||
|       "Amjad Khan", | ||||
|       "Muhammad Ahmed", | ||||
|       "Majid Ali", | ||||
|       "Faris Mahmoud", | ||||
|     ]; | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: MediaQuery.of(context).size.height - 80, | ||||
|       child: Column( | ||||
|         children: [ | ||||
|           Expanded( | ||||
|             child: SingleChildScrollView( | ||||
|               child: Padding( | ||||
|                 padding: EdgeInsets.all(21), | ||||
|                 child: Column( | ||||
|                   crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                   children: [ | ||||
|                     "Delegate".toText24(), | ||||
|                     24.height, | ||||
|                     "Search".toText16(), | ||||
|                     12.height, | ||||
|                     Row( | ||||
|                       children: [ | ||||
|                         Expanded( | ||||
|                           flex: 2, | ||||
|                           child: ShowRadio( | ||||
|                               title: "Name", value: "Name", groupValue: "Name"), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           flex: 3, | ||||
|                           child: ShowRadio( | ||||
|                               title: "User Name", | ||||
|                               value: "User Name", | ||||
|                               groupValue: "Name"), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           flex: 2, | ||||
|                           child: ShowRadio( | ||||
|                               title: "Email", | ||||
|                               value: "Email", | ||||
|                               groupValue: "Name"), | ||||
|                         ), | ||||
|                       ], | ||||
|                     ), | ||||
|                     20.height, | ||||
|                     InputWidget( | ||||
|                       "Search By Username", | ||||
|                       "", | ||||
|                       username, | ||||
|                       isBackgroundEnable: true, | ||||
|                     ), | ||||
|                     24.height, | ||||
|                     "Related".toText16(), | ||||
|                     12.height, | ||||
|                     ListView.separated( | ||||
|                       itemBuilder: (context, index) { | ||||
|                         return showItem(context, related[index]); | ||||
|                       }, | ||||
|                       separatorBuilder: (context, index) { | ||||
|                         return Container( | ||||
|                           color: MyColors.borderColor, | ||||
|                           width: double.infinity, | ||||
|                           height: 1, | ||||
|                           margin: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                         ); | ||||
|                       }, | ||||
|                       physics: NeverScrollableScrollPhysics(), | ||||
|                       shrinkWrap: true, | ||||
|                       itemCount: related.length, | ||||
|                       padding: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                     ), | ||||
|                     24.height, | ||||
|                     "Favorites".toText16(), | ||||
|                     12.height, | ||||
|                     ListView.separated( | ||||
|                       itemBuilder: (context, index) { | ||||
|                         return showItem(context, favorites[index], | ||||
|                             isEnabled: true); | ||||
|                       }, | ||||
|                       separatorBuilder: (context, index) { | ||||
|                         return Container( | ||||
|                           color: MyColors.borderColor, | ||||
|                           width: double.infinity, | ||||
|                           height: 1, | ||||
|                           margin: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                         ); | ||||
|                       }, | ||||
|                       physics: NeverScrollableScrollPhysics(), | ||||
|                       shrinkWrap: true, | ||||
|                       itemCount: favorites.length, | ||||
|                       padding: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|             ), | ||||
|           ), | ||||
|           Container( | ||||
|             width: double.infinity, | ||||
|             height: 1, | ||||
|             color: MyColors.borderColor, | ||||
|           ), | ||||
|           DefaultButton( | ||||
|             "Cancel", | ||||
|             () { | ||||
|               Navigator.pop(context); | ||||
|             }, | ||||
|             textColor: Colors.black, | ||||
|             colors: [ | ||||
|               Color(0xffE6E6E6), | ||||
|               Color(0xffE6E6E6), | ||||
|             ], | ||||
|           ).insideContainer | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget showItem(BuildContext context, String name, {bool isEnabled = false}) { | ||||
|     return InkWell( | ||||
|       onTap: () { | ||||
|         showMyBottomSheet(context, child: SelectedItemSheet("Delegate")); | ||||
|       }, | ||||
|       child: Row( | ||||
|         children: [ | ||||
|           CircularAvatar( | ||||
|             height: 30, | ||||
|             width: 30, | ||||
|           ), | ||||
|           16.width, | ||||
|           Expanded( | ||||
|             child: name.toText12(), | ||||
|           ), | ||||
|           Icon( | ||||
|             Icons.star, | ||||
|             size: 16, | ||||
|             color: isEnabled ? MyColors.yellowColor : MyColors.borderColor, | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,165 @@ | ||||
| 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'; | ||||
| import 'package:mohem_flutter_app/ui/work_list/sheets/selected_item_sheet.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/bottom_sheet.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/input_widget.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/radio/show_radio.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| 
 | ||||
| class RequestMoreInfoSheet extends StatelessWidget { | ||||
|   TextEditingController username = TextEditingController(); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     List<String> related = [ | ||||
|       "Amjad Khan", | ||||
|       "Munahi Nasser", | ||||
|     ]; | ||||
|     List<String> favorites = [ | ||||
|       "Amjad Khan", | ||||
|       "Muhammad Ahmed", | ||||
|       "Majid Ali", | ||||
|       "Faris Mahmoud", | ||||
|     ]; | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: MediaQuery.of(context).size.height - 80, | ||||
|       child: Column( | ||||
|         children: [ | ||||
|           Expanded( | ||||
|             child: SingleChildScrollView( | ||||
|               child: Padding( | ||||
|                 padding: EdgeInsets.all(21), | ||||
|                 child: Column( | ||||
|                   crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                   children: [ | ||||
|                     "Request more info".toText24(), | ||||
|                     24.height, | ||||
|                     "Search".toText16(), | ||||
|                     12.height, | ||||
|                     Row( | ||||
|                       children: [ | ||||
|                         Expanded( | ||||
|                           flex: 2, | ||||
|                           child: ShowRadio( | ||||
|                               title: "Name", value: "Name", groupValue: "Name"), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           flex: 3, | ||||
|                           child: ShowRadio( | ||||
|                               title: "User Name", | ||||
|                               value: "User Name", | ||||
|                               groupValue: "Name"), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           flex: 2, | ||||
|                           child: ShowRadio( | ||||
|                               title: "Email", | ||||
|                               value: "Email", | ||||
|                               groupValue: "Name"), | ||||
|                         ), | ||||
|                       ], | ||||
|                     ), | ||||
|                     20.height, | ||||
|                     InputWidget( | ||||
|                       "Search By Username", | ||||
|                       "", | ||||
|                       username, | ||||
|                       isBackgroundEnable: true, | ||||
|                     ), | ||||
|                     24.height, | ||||
|                     "Related".toText16(), | ||||
|                     12.height, | ||||
|                     ListView.separated( | ||||
|                       itemBuilder: (context, index) { | ||||
|                         return showItem(context, related[index]); | ||||
|                       }, | ||||
|                       separatorBuilder: (context, index) { | ||||
|                         return Container( | ||||
|                           color: MyColors.borderColor, | ||||
|                           width: double.infinity, | ||||
|                           height: 1, | ||||
|                           margin: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                         ); | ||||
|                       }, | ||||
|                       physics: NeverScrollableScrollPhysics(), | ||||
|                       shrinkWrap: true, | ||||
|                       itemCount: related.length, | ||||
|                       padding: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                     ), | ||||
|                     24.height, | ||||
|                     "Favorites".toText16(), | ||||
|                     12.height, | ||||
|                     ListView.separated( | ||||
|                       itemBuilder: (context, index) { | ||||
|                         return showItem(context, favorites[index], | ||||
|                             isEnabled: true); | ||||
|                       }, | ||||
|                       separatorBuilder: (context, index) { | ||||
|                         return Container( | ||||
|                           color: MyColors.borderColor, | ||||
|                           width: double.infinity, | ||||
|                           height: 1, | ||||
|                           margin: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                         ); | ||||
|                       }, | ||||
|                       physics: NeverScrollableScrollPhysics(), | ||||
|                       shrinkWrap: true, | ||||
|                       itemCount: favorites.length, | ||||
|                       padding: EdgeInsets.only(top: 8, bottom: 8), | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|             ), | ||||
|           ), | ||||
|           Container( | ||||
|             width: double.infinity, | ||||
|             height: 1, | ||||
|             color: MyColors.borderColor, | ||||
|           ), | ||||
|           DefaultButton( | ||||
|             "Cancel", | ||||
|             () { | ||||
|               Navigator.pop(context); | ||||
|             }, | ||||
|             textColor: Colors.black, | ||||
|             colors: [ | ||||
|               Color(0xffE6E6E6), | ||||
|               Color(0xffE6E6E6), | ||||
|             ], | ||||
|           ).insideContainer | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget showItem(BuildContext context, String name, {bool isEnabled = false}) { | ||||
|     return InkWell( | ||||
|       onTap: () { | ||||
|         showMyBottomSheet(context, child: SelectedItemSheet("Request more info")); | ||||
|       }, | ||||
|       child: Row( | ||||
|         children: [ | ||||
|           CircularAvatar( | ||||
|             height: 30, | ||||
|             width: 30, | ||||
|           ), | ||||
|           16.width, | ||||
|           Expanded( | ||||
|             child: name.toText12(), | ||||
|           ), | ||||
|           Icon( | ||||
|             Icons.star, | ||||
|             size: 16, | ||||
|             color: isEnabled ? MyColors.yellowColor : MyColors.borderColor, | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,151 @@ | ||||
| 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'; | ||||
| import 'package:mohem_flutter_app/widgets/button/default_button.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/circular_avatar.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/input_widget.dart'; | ||||
| import 'package:mohem_flutter_app/widgets/radio/show_radio.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; | ||||
| 
 | ||||
| class SelectedItemSheet extends StatelessWidget { | ||||
|   String title; | ||||
| 
 | ||||
|   SelectedItemSheet(this.title); | ||||
| 
 | ||||
|   TextEditingController username = TextEditingController(); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       width: double.infinity, | ||||
|       height: MediaQuery.of(context).size.height - 80, | ||||
|       child: Column( | ||||
|         children: [ | ||||
|           Expanded( | ||||
|             child: SingleChildScrollView( | ||||
|               child: Padding( | ||||
|                 padding: EdgeInsets.all(21), | ||||
|                 child: Column( | ||||
|                   crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                   children: [ | ||||
|                     title.toText24(), | ||||
|                     24.height, | ||||
|                     "Search".toText16(), | ||||
|                     12.height, | ||||
|                     Row( | ||||
|                       children: [ | ||||
|                         Expanded( | ||||
|                           flex: 2, | ||||
|                           child: ShowRadio( | ||||
|                               title: "Name", value: "Name", groupValue: "Name"), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           flex: 3, | ||||
|                           child: ShowRadio( | ||||
|                               title: "User Name", | ||||
|                               value: "User Name", | ||||
|                               groupValue: "Name"), | ||||
|                         ), | ||||
|                         Expanded( | ||||
|                           flex: 2, | ||||
|                           child: ShowRadio( | ||||
|                               title: "Email", | ||||
|                               value: "Email", | ||||
|                               groupValue: "Name"), | ||||
|                         ), | ||||
|                       ], | ||||
|                     ), | ||||
|                     20.height, | ||||
|                     showItem("name"), | ||||
|                     20.height, | ||||
|                     InputWidget( | ||||
|                       "Enter a note", | ||||
|                       "This is simple note", | ||||
|                       username, | ||||
|                       isBackgroundEnable: true, | ||||
|                       lines: 5, | ||||
|                     ), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|             ), | ||||
|           ), | ||||
|           Container( | ||||
|             width: double.infinity, | ||||
|             height: 1, | ||||
|             color: MyColors.borderColor, | ||||
|           ), | ||||
|           Row( | ||||
|             children: [ | ||||
|               Expanded( | ||||
|                 child: DefaultButton( | ||||
|                   "Cancel", | ||||
|                   () { | ||||
|                     Navigator.pop(context); | ||||
|                   }, | ||||
|                   textColor: Colors.black, | ||||
|                   colors: [ | ||||
|                     Color(0xffE6E6E6), | ||||
|                     Color(0xffE6E6E6), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|               16.width, | ||||
|               Expanded( | ||||
|                 child: DefaultButton( | ||||
|                   "Submit", | ||||
|                   () { | ||||
|                     Navigator.pop(context); | ||||
|                   }, | ||||
|                   colors: [ | ||||
|                     Color(0xff32D892), | ||||
|                     Color(0xff1AB170), | ||||
|                   ], | ||||
|                 ), | ||||
|               ), | ||||
|             ], | ||||
|           ).insideContainer | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Widget showItem(String name) { | ||||
|     return Container( | ||||
|       decoration: BoxDecoration( | ||||
|         borderRadius: BorderRadius.circular(15), | ||||
|         color: Color(0xffF7F7F7), | ||||
|         border: Border.all( | ||||
|           color: Color(0xffefefef), | ||||
|           width: 1, | ||||
|         ), | ||||
|       ), | ||||
|       padding: EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21), | ||||
|       child: Row( | ||||
|         children: [ | ||||
|           CircularAvatar( | ||||
|             height: 30, | ||||
|             width: 30, | ||||
|           ), | ||||
|           16.width, | ||||
|           Expanded( | ||||
|             child: name.toText12(), | ||||
|           ), | ||||
|           Container( | ||||
|             decoration: BoxDecoration( | ||||
|               color: MyColors.redColor, | ||||
|               borderRadius: BorderRadius.all(Radius.circular(100)), | ||||
|             ), | ||||
|             padding: EdgeInsets.all(3), | ||||
|             child: Icon( | ||||
|               Icons.star, | ||||
|               size: 12, | ||||
|               color: Colors.white, | ||||
|             ), | ||||
|           ), | ||||
|         ], | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,41 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| 
 | ||||
| showMyBottomSheet(BuildContext context, {required Widget child}) { | ||||
|   showModalBottomSheet<void>( | ||||
|     context: context, | ||||
|     isScrollControlled: true, | ||||
|     backgroundColor: Colors.transparent, | ||||
|     builder: (BuildContext context) { | ||||
|       return Container( | ||||
|         decoration: BoxDecoration( | ||||
|           color: Colors.white, | ||||
|           borderRadius: BorderRadius.only( | ||||
|             topRight: Radius.circular(24), | ||||
|             topLeft: Radius.circular(24), | ||||
|           ), | ||||
|         ), | ||||
|         clipBehavior: Clip.antiAlias, | ||||
|         child: Column( | ||||
|           mainAxisAlignment: MainAxisAlignment.center, | ||||
|           mainAxisSize: MainAxisSize.min, | ||||
|           children: <Widget>[ | ||||
|             8.height, | ||||
|             Container( | ||||
|               height: 6, | ||||
|               width: 60, | ||||
|               decoration: BoxDecoration( | ||||
|                 color: Colors.grey[200], | ||||
|                 borderRadius: BorderRadius.all( | ||||
|                   Radius.circular(20), | ||||
|                 ), | ||||
|               ), | ||||
|             ), | ||||
|             8.height, | ||||
|             child, | ||||
|           ], | ||||
|         ), | ||||
|       ); | ||||
|     }, | ||||
|   ); | ||||
| } | ||||
| @ -0,0 +1,41 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:mohem_flutter_app/classes/colors.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/string_extensions.dart'; | ||||
| import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | ||||
| 
 | ||||
| class ShowRadio extends StatelessWidget { | ||||
|   String title, value, groupValue; | ||||
| 
 | ||||
|   ShowRadio( | ||||
|       {required this.title, required this.value, required this.groupValue}); | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Row( | ||||
|       mainAxisSize: MainAxisSize.min, | ||||
|       children: [ | ||||
|         Container( | ||||
|           width: 24, | ||||
|           height: 24, | ||||
|           decoration: BoxDecoration( | ||||
|             color: Colors.transparent, | ||||
|             border: Border.all(color: MyColors.grey98Color, width: 0.5), | ||||
|             borderRadius: BorderRadius.all(Radius.circular(100)), | ||||
|           ), | ||||
|           padding: EdgeInsets.all(4), | ||||
|           child: Container( | ||||
|             width: double.infinity, | ||||
|             height: double.infinity, | ||||
|             decoration: BoxDecoration( | ||||
|               color: value == groupValue ? Colors.black : Colors.transparent, | ||||
|               borderRadius: BorderRadius.all(Radius.circular(100)), | ||||
|             ), | ||||
|           ), | ||||
|         ), | ||||
|         12.width, | ||||
|         title.toText12(isBold: true) | ||||
|       ], | ||||
|     ); | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue