|  |  |  | @ -37,7 +37,8 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |       timeInSecForIosWeb: 1, | 
		
	
		
			
				|  |  |  |  |       backgroundColor: Colors.black54, | 
		
	
		
			
				|  |  |  |  |       textColor: Colors.white, | 
		
	
		
			
				|  |  |  |  |         fontSize: 13.0); | 
		
	
		
			
				|  |  |  |  |       fontSize: 13.0, | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static dynamic getNotNullValue(List<dynamic> list, int index) { | 
		
	
	
		
			
				
					|  |  |  | @ -63,12 +64,7 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |   static void showLoading(BuildContext context) { | 
		
	
		
			
				|  |  |  |  |     WidgetsBinding.instance.addPostFrameCallback((_) { | 
		
	
		
			
				|  |  |  |  |       _isLoadingVisible = true; | 
		
	
		
			
				|  |  |  |  |       showDialog( | 
		
	
		
			
				|  |  |  |  |         context: context, | 
		
	
		
			
				|  |  |  |  |         barrierColor: Colors.black.withOpacity(0.5), | 
		
	
		
			
				|  |  |  |  |         useRootNavigator: false, | 
		
	
		
			
				|  |  |  |  |         builder: (BuildContext context) => LoadingDialog(), | 
		
	
		
			
				|  |  |  |  |       ).then((value) { | 
		
	
		
			
				|  |  |  |  |       showDialog(context: context, barrierColor: Colors.black.withOpacity(0.5), useRootNavigator: false, builder: (BuildContext context) => LoadingDialog()).then((value) { | 
		
	
		
			
				|  |  |  |  |         _isLoadingVisible = false; | 
		
	
		
			
				|  |  |  |  |       }); | 
		
	
		
			
				|  |  |  |  |     }); | 
		
	
	
		
			
				
					|  |  |  | @ -118,7 +114,8 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |           showDialog( | 
		
	
		
			
				|  |  |  |  |             barrierDismissible: false, | 
		
	
		
			
				|  |  |  |  |             context: cxt, | 
		
	
		
			
				|  |  |  |  |             builder: (cxt) => ConfirmDialog( | 
		
	
		
			
				|  |  |  |  |             builder: | 
		
	
		
			
				|  |  |  |  |                 (cxt) => ConfirmDialog( | 
		
	
		
			
				|  |  |  |  |                   message: errorMessage, | 
		
	
		
			
				|  |  |  |  |                   onTap: () { | 
		
	
		
			
				|  |  |  |  |                     Navigator.pushNamedAndRemoveUntil(cxt, AppRoutes.login, (Route<dynamic> route) => false); | 
		
	
	
		
			
				
					|  |  |  | @ -138,33 +135,18 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static Future showErrorDialog({required BuildContext context, required VoidCallback onOkTapped, required String message}) async { | 
		
	
		
			
				|  |  |  |  |     return showDialog( | 
		
	
		
			
				|  |  |  |  |       context: context, | 
		
	
		
			
				|  |  |  |  |       builder: (BuildContext context) => ConfirmDialog( | 
		
	
		
			
				|  |  |  |  |         message: message, | 
		
	
		
			
				|  |  |  |  |         onTap: onOkTapped, | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |     return showDialog(context: context, builder: (BuildContext context) => ConfirmDialog(message: message, onTap: onOkTapped)); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static void confirmDialog(cxt, String message, {VoidCallback? onTap}) { | 
		
	
		
			
				|  |  |  |  |     showDialog( | 
		
	
		
			
				|  |  |  |  |       context: cxt, | 
		
	
		
			
				|  |  |  |  |       builder: (BuildContext cxt) => ConfirmDialog( | 
		
	
		
			
				|  |  |  |  |         message: message, | 
		
	
		
			
				|  |  |  |  |         onTap: onTap, | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |     showDialog(context: cxt, builder: (BuildContext cxt) => ConfirmDialog(message: message, onTap: onTap)); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static Widget getNoDataWidget(BuildContext context) { | 
		
	
		
			
				|  |  |  |  |     return Column( | 
		
	
		
			
				|  |  |  |  |       mainAxisAlignment: MainAxisAlignment.center, | 
		
	
		
			
				|  |  |  |  |       crossAxisAlignment: CrossAxisAlignment.center, | 
		
	
		
			
				|  |  |  |  |       children: [ | 
		
	
		
			
				|  |  |  |  |         SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0), | 
		
	
		
			
				|  |  |  |  |         LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15), | 
		
	
		
			
				|  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |       children: [SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0), LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15)], | 
		
	
		
			
				|  |  |  |  |     ).center; | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -172,10 +154,7 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |     return Column( | 
		
	
		
			
				|  |  |  |  |       mainAxisAlignment: MainAxisAlignment.center, | 
		
	
		
			
				|  |  |  |  |       crossAxisAlignment: CrossAxisAlignment.center, | 
		
	
		
			
				|  |  |  |  |       children: [ | 
		
	
		
			
				|  |  |  |  |         SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0), | 
		
	
		
			
				|  |  |  |  |         LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15), | 
		
	
		
			
				|  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |       children: [SvgPicture.asset('assets/images/not_found.svg', width: 110.0, height: 110.0), LocaleKeys.noDataAvailable.tr().toText16().paddingOnly(top: 15)], | 
		
	
		
			
				|  |  |  |  |     ).center; | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -209,17 +188,7 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |     return Column( | 
		
	
		
			
				|  |  |  |  |       crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |       mainAxisSize: MainAxisSize.min, | 
		
	
		
			
				|  |  |  |  |       children: [ | 
		
	
		
			
				|  |  |  |  |         6.height, | 
		
	
		
			
				|  |  |  |  |         alignCenter ? text.toText12().center : text.toText12(), | 
		
	
		
			
				|  |  |  |  |         5.height, | 
		
	
		
			
				|  |  |  |  |         if (showDivider) | 
		
	
		
			
				|  |  |  |  |           const Divider( | 
		
	
		
			
				|  |  |  |  |             height: 1, | 
		
	
		
			
				|  |  |  |  |             color: Color(0xff2E303A), | 
		
	
		
			
				|  |  |  |  |             thickness: 1, | 
		
	
		
			
				|  |  |  |  |           ) | 
		
	
		
			
				|  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |       children: [6.height, alignCenter ? text.toText12().center : text.toText12(), 5.height, if (showDivider) const Divider(height: 1, color: Color(0xff2E303A), thickness: 1)], | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -228,16 +197,14 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |       color: background, | 
		
	
		
			
				|  |  |  |  |       border: Border.all( | 
		
	
		
			
				|  |  |  |  |         width: 1, // | 
		
	
		
			
				|  |  |  |  |           color: background //                  <--- border width here | 
		
	
		
			
				|  |  |  |  |         color: background, //                  <--- border width here | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |       borderRadius: BorderRadius.circular(radius), | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static Widget mHeight(double h) { | 
		
	
		
			
				|  |  |  |  |     return Container( | 
		
	
		
			
				|  |  |  |  |       height: h, | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |     return Container(height: h); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static Widget mDivider(Color color) { | 
		
	
	
		
			
				
					|  |  |  | @ -352,7 +319,8 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |     if (!Platform.isIOS) { | 
		
	
		
			
				|  |  |  |  |       await showCupertinoModalPopup( | 
		
	
		
			
				|  |  |  |  |         context: context, | 
		
	
		
			
				|  |  |  |  |         builder: (BuildContext cxt) => Container( | 
		
	
		
			
				|  |  |  |  |         builder: | 
		
	
		
			
				|  |  |  |  |             (BuildContext cxt) => Container( | 
		
	
		
			
				|  |  |  |  |               height: 250, | 
		
	
		
			
				|  |  |  |  |               color: Colors.white, | 
		
	
		
			
				|  |  |  |  |               child: CupertinoDatePicker( | 
		
	
	
		
			
				
					|  |  |  | @ -377,9 +345,12 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static void readNFc({required Function(String) onRead}) { | 
		
	
		
			
				|  |  |  |  |     NfcManager.instance.startSession(onDiscovered: (NfcTag tag) async { | 
		
	
		
			
				|  |  |  |  |     NfcManager.instance | 
		
	
		
			
				|  |  |  |  |         .startSession( | 
		
	
		
			
				|  |  |  |  |           onDiscovered: (NfcTag tag) async { | 
		
	
		
			
				|  |  |  |  |             MifareUltralight f; | 
		
	
		
			
				|  |  |  |  |             if (Platform.isAndroid) { | 
		
	
		
			
				|  |  |  |  |               print(tag); | 
		
	
		
			
				|  |  |  |  |               f = MifareUltralight(tag: tag, identifier: tag.data["nfca"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22); | 
		
	
		
			
				|  |  |  |  |             } else { | 
		
	
		
			
				|  |  |  |  |               f = MifareUltralight(tag: tag, identifier: tag.data["mifare"]["identifier"], type: 2, maxTransceiveLength: 252, timeout: 22); | 
		
	
	
		
			
				
					|  |  |  | @ -387,7 +358,10 @@ class Utils { | 
		
	
		
			
				|  |  |  |  |             String identifier = f.identifier.map((e) => e.toRadixString(16).padLeft(2, '0')).join(''); | 
		
	
		
			
				|  |  |  |  |             NfcManager.instance.stopSession(); | 
		
	
		
			
				|  |  |  |  |             onRead(identifier); | 
		
	
		
			
				|  |  |  |  |     }).catchError((err) { | 
		
	
		
			
				|  |  |  |  |           }, | 
		
	
		
			
				|  |  |  |  |           pollingOptions: {NfcPollingOption.iso14443}, | 
		
	
		
			
				|  |  |  |  |         ) | 
		
	
		
			
				|  |  |  |  |         .catchError((err) { | 
		
	
		
			
				|  |  |  |  |           print(err); | 
		
	
		
			
				|  |  |  |  |         }); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
	
		
			
				
					|  |  |  | 
 |