Merge branch 'refs/heads/master' into faiz_dev1
# Conflicts: # pubspec.yamlpull/12/head
						commit
						702c504d4e
					
				| @ -0,0 +1,4 @@ | ||||
| <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
| <path d="M8.26704 17.0625C7.11121 17.0625 5.9391 17.0625 5.2024 16.9854C4.44534 16.9062 3.79943 16.7389 3.24085 16.3439C2.94808 16.1369 2.68667 15.8903 2.46528 15.6109C2.03791 15.0716 1.85547 14.4432 1.76989 13.7132C1.68747 13.0102 1.68748 12.1307 1.6875 11.0446L1.6875 9.10701C1.6875 8.04332 1.6875 7.20881 1.73189 6.53328C1.77708 5.84565 1.87048 5.27212 2.08131 4.73815C2.71386 3.1361 4.04416 1.88905 5.70916 1.30241C6.74599 0.937106 8.01098 0.937263 10.1407 0.937534C11.3069 0.937127 12.411 0.936836 13.0551 1.16377C14.0875 1.52753 14.9188 2.30323 15.3154 3.30771C15.4529 3.65583 15.5096 4.02009 15.5365 4.42856C15.5625 4.82499 15.5625 5.31066 15.5625 5.91003V8.26973C15.5625 8.67305 15.2355 9 14.8322 9C14.4289 9 14.102 8.67305 14.102 8.26973V5.93492C14.102 5.30472 14.1016 4.86751 14.0791 4.52501C14.057 4.18904 14.0159 3.99523 13.9576 3.84775C13.7251 3.25872 13.2258 2.77749 12.5713 2.5469C12.1938 2.41389 11.6935 2.40342 10.3179 2.40342C10.0943 2.40342 9.82675 2.4043 9.57313 2.40544C9.31951 2.40659 8.90446 2.40846 8.55785 2.61013C8.3293 2.74312 8.16373 2.89454 8.06871 3.05998C7.9057 3.34379 7.81241 3.64914 7.81241 3.9999L7.83978 4.78018C7.8457 5.06525 7.83669 5.3979 7.75065 5.71901C7.58306 6.34449 7.0945 6.83305 6.46902 7.00064C6.14791 7.08669 5.81526 7.09569 5.53018 7.08977L4.74991 7.0624C4.41491 7.0624 4.09976 7.14742 3.82488 7.29707C3.65429 7.38993 3.48823 7.57226 3.35853 7.79049C3.14807 8.14462 3.14794 8.62354 3.14795 8.82381L3.14802 10.9989C3.14802 12.1415 3.1492 12.9345 3.22039 13.5419C3.28957 14.1319 3.41665 14.4565 3.60832 14.6984C3.74167 14.8667 3.90095 15.0175 4.08204 15.1456C4.35042 15.3353 4.71336 15.4604 5.3538 15.5274C6.00588 15.5956 7.06057 15.5966 8.26704 15.5966C8.67184 15.5966 9 15.9247 9 16.3296C9 16.7344 8.67184 17.0625 8.26704 17.0625Z" fill="#8F9AA3"/> | ||||
| <path d="M12.3737 9.18753C11.7129 9.18753 11.181 9.40076 10.7414 9.61709C10.5956 9.6889 10.4675 9.75603 10.35 9.81766C10.0849 9.95665 9.87309 10.0677 9.6297 10.1415C9.47677 10.1878 9.32171 10.2348 9.21338 10.2752C9.11899 10.3103 8.94856 10.3771 8.81729 10.5157C8.7011 10.6383 8.64553 10.7732 8.61318 10.8809C8.58617 10.9708 8.56326 11.0918 8.54641 11.1808C8.08141 13.6308 9.10597 15.9887 11.6102 16.8995C11.8405 16.9834 12.0578 17.0625 12.3748 17.0625C12.6919 17.0625 12.9092 16.9834 13.1395 16.8995C15.6437 15.9886 16.6672 13.6306 16.2021 11.1808C16.1852 11.0918 16.1623 10.9707 16.1353 10.8808C16.103 10.7732 16.0474 10.6383 15.9311 10.5156C15.7999 10.377 15.6294 10.3102 15.535 10.2751C15.4267 10.2348 15.2716 10.1878 15.1187 10.1415C14.8752 10.0677 14.6631 9.9566 14.3978 9.81757C14.2802 9.75594 14.1522 9.68884 14.0063 9.61706C13.5665 9.40075 13.0344 9.18753 12.3737 9.18753Z" fill="#8F9AA3"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.7 KiB | 
| @ -0,0 +1,4 @@ | ||||
| <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
| <path d="M7.51704 17.0625C6.36121 17.0625 5.9391 17.0625 5.2024 16.9854C4.44534 16.9062 3.79943 16.7389 3.24085 16.3439C2.94808 16.1369 2.68667 15.8903 2.46528 15.6109C2.03791 15.0716 1.85547 14.4432 1.76989 13.7132C1.68747 13.0102 1.68748 12.1307 1.6875 11.0446L1.6875 9.10701C1.6875 8.04332 1.6875 7.20881 1.73189 6.53328C1.77708 5.84565 1.87048 5.27212 2.08131 4.73815C2.71386 3.1361 4.04416 1.88905 5.70916 1.30241C6.74599 0.937106 8.01098 0.937263 10.1407 0.937534C11.3069 0.937127 12.411 0.936836 13.0551 1.16377C14.0875 1.52753 14.9188 2.30323 15.3154 3.30771C15.4529 3.65583 15.5096 4.02009 15.5365 4.42856C15.5625 4.82499 15.5625 5.31066 15.5625 5.91003V8.26973C15.5625 8.67305 15.2355 9 14.8322 9C14.4289 9 14.102 8.67305 14.102 8.26973V5.93492C14.102 5.30472 14.1016 4.86751 14.0791 4.52501C14.057 4.18904 14.0159 3.99523 13.9576 3.84775C13.7251 3.25872 13.2258 2.77749 12.5713 2.5469C12.1938 2.41389 11.6935 2.40342 10.3179 2.40342C10.0943 2.40342 9.82675 2.4043 9.57313 2.40544C9.31951 2.40659 8.90446 2.40846 8.55785 2.61013C8.3293 2.74312 8.16373 2.89454 8.06871 3.05998C7.9057 3.34379 7.81241 3.64914 7.81241 3.9999L7.83978 4.78018C7.8457 5.06525 7.83669 5.3979 7.75065 5.71901C7.58306 6.34449 7.0945 6.83305 6.46902 7.00064C6.14791 7.08669 5.81526 7.09569 5.53018 7.08977L4.74991 7.0624C4.41491 7.0624 4.09976 7.14742 3.82488 7.29707C3.65429 7.38993 3.48823 7.57226 3.35853 7.79049C3.14807 8.14462 3.14794 8.62354 3.14795 8.82381L3.14802 10.9989C3.14802 12.1415 3.1492 12.9345 3.22039 13.5419C3.28957 14.1319 3.41665 14.4565 3.60832 14.6984C3.74167 14.8667 3.90095 15.0175 4.08204 15.1456C4.35042 15.3353 4.71336 15.4604 5.3538 15.5274C6.00588 15.5956 6.31057 15.5966 7.51704 15.5966C7.92184 15.5966 8.25 15.9247 8.25 16.3296C8.25 16.7344 7.92184 17.0625 7.51704 17.0625Z" fill="#8F9AA3"/> | ||||
| <path d="M13.4633 9.98792C13.2634 9.58309 12.9024 9.18753 12.375 9.18753C11.8482 9.18753 11.4863 9.58226 11.2848 9.98649L10.6925 11.1809C10.6722 11.2217 10.6319 11.237 10.6143 11.2395L9.54899 11.418C9.10502 11.4926 8.64096 11.7274 8.48559 12.218C8.3309 12.7064 8.5719 13.1659 8.88821 13.4849L9.71995 14.3235C9.73567 14.3342 9.76362 14.3708 9.7497 14.4315L9.51213 15.4672C9.40639 15.928 9.40686 16.5325 9.87131 16.8742C10.3385 17.2179 10.9155 17.0328 11.3208 16.7904L12.3212 16.1933C12.3668 16.1661 12.4113 16.1813 12.4279 16.1923L13.4302 16.7905C13.8344 17.0313 14.4127 17.2194 14.8805 16.8756C15.346 16.5335 15.3437 15.9272 15.2387 15.4677L15.001 14.4315C14.9884 14.3763 15.0156 14.3365 15.0308 14.3235L15.8612 13.4862L15.8619 13.4855C16.1802 13.1664 16.4221 12.7063 16.2661 12.217C16.1099 11.7269 15.6454 11.4925 15.202 11.418L14.1337 11.239C14.0902 11.2318 14.063 11.1972 14.0549 11.1808L13.4633 9.98792Z" fill="#8F9AA3"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.8 KiB | 
| @ -0,0 +1,5 @@ | ||||
| <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
| <path d="M12.7493 12.75C12.7493 13.1643 12.4135 13.5 11.9993 13.5H6.74927C6.33505 13.5 5.99927 13.1643 5.99927 12.75C5.99927 12.3358 6.33505 12 6.74927 12L11.9993 12C12.4135 12 12.7493 12.3358 12.7493 12.75Z" fill="#8F9AA3"/> | ||||
| <path d="M11.9993 10.5C12.4135 10.5 12.7493 10.1643 12.7493 9.75005C12.7493 9.33583 12.4135 9.00005 11.9993 9.00005H9.74927C9.33506 9.00005 8.99927 9.33583 8.99927 9.75004C8.99927 10.1643 9.33506 10.5 9.74927 10.5H11.9993Z" fill="#8F9AA3"/> | ||||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M5.57667 16.9854C6.31336 17.0625 7.23796 17.0625 8.39379 17.0625H9.05029C10.47 17.0625 11.6054 17.0625 12.4965 16.9493C13.4148 16.8327 14.1838 16.5847 14.798 16.0046C15.4184 15.4185 15.6894 14.6746 15.8158 13.7866C15.9368 12.9363 15.9368 11.8564 15.9368 10.5224V5.91003C15.9368 5.31066 15.9368 4.82499 15.9107 4.42856C15.8839 4.02009 15.8272 3.65583 15.6897 3.30771C15.2931 2.30323 14.4618 1.52753 13.4294 1.16377C12.7853 0.936835 11.6812 0.937127 10.515 0.937534C8.38525 0.937264 7.12025 0.937105 6.08343 1.30241C4.41843 1.88904 3.08813 3.1361 2.45558 4.73815C2.24475 5.27212 2.15135 5.84565 2.10616 6.53328C2.06176 7.20882 2.06177 8.04328 2.06177 9.10699L2.06177 11.0446C2.06175 12.1307 2.06174 13.0102 2.14415 13.7132C2.22974 14.4432 2.41218 15.0716 2.83955 15.6109C3.06094 15.8903 3.32235 16.1369 3.61512 16.3439C4.17369 16.7389 4.81961 16.9062 5.57667 16.9854ZM13.797 14.9371C13.5021 15.2156 13.085 15.397 12.3131 15.495C11.5245 15.5952 10.4818 15.5965 8.99926 15.5965H8.43496C7.2285 15.5965 6.38015 15.5956 5.72807 15.5274C5.08762 15.4604 4.72468 15.3353 4.45631 15.1456C4.27522 15.0175 4.11594 14.8667 3.98259 14.6984C3.79092 14.4565 3.66384 14.1319 3.59466 13.5418C3.52346 12.9345 3.52228 12.1415 3.52228 10.9989L3.52222 8.82381C3.52221 8.62354 3.52234 8.14462 3.7328 7.79049C3.8625 7.57226 4.02856 7.38993 4.19915 7.29707C4.47403 7.14742 4.78918 7.0624 5.12418 7.0624L5.90445 7.08977C6.18952 7.09569 6.52218 7.08668 6.84329 7.00064C7.46877 6.83305 7.95732 6.34449 8.12492 5.71901C8.21096 5.3979 8.21996 5.06525 8.21405 4.78018L8.18668 3.9999C8.18668 3.64913 8.27997 3.34379 8.44298 3.05998C8.538 2.89454 8.70357 2.74312 8.93212 2.61014C9.27873 2.40845 9.69378 2.40658 9.9474 2.40544C10.201 2.4043 10.4686 2.40342 10.6921 2.40342C12.0677 2.40342 12.5681 2.41389 12.9456 2.5469C13.6001 2.77749 14.0993 3.25872 14.3319 3.84775C14.3901 3.99523 14.4313 4.18904 14.4534 4.52501C14.4759 4.86751 14.4762 5.30472 14.4762 5.93492V10.4659C14.4762 11.8699 14.4745 12.8447 14.3699 13.5792C14.2691 14.2879 14.0856 14.6644 13.797 14.9371Z" fill="#8F9AA3"/> | ||||
| </svg> | ||||
| After Width: | Height: | Size: 2.6 KiB | 
| @ -0,0 +1,92 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| 
 | ||||
| import 'package:permission_handler/permission_handler.dart'; | ||||
| 
 | ||||
| // import 'package:vibration/vibration.dart'; | ||||
| import 'package:geolocator/geolocator.dart' as geo; | ||||
| 
 | ||||
| class PermissionService { | ||||
|   // final LocalStorage storage = new LocalStorage("permission"); | ||||
|   geo.LocationPermission? locationPermission; | ||||
| 
 | ||||
|   // AppGlobal appGlobal = new AppGlobal(); | ||||
| 
 | ||||
|   // setVibrationPermission(flag) async { | ||||
|   //   storage.setItem('isVibration', flag); | ||||
|   // } | ||||
|   // | ||||
|   // isVibrationEnabled() { | ||||
|   //   return (storage.getItem('isVibration') == null) || | ||||
|   //           (storage.getItem('isVibration')) == false | ||||
|   //       ? false | ||||
|   //       : true; | ||||
|   // } | ||||
| 
 | ||||
|   // vibrate(callback, context) async { | ||||
|   //   if (callback == null) return null; | ||||
|   //   if (isVibrationEnabled() == true) { | ||||
|   //     // if (await Vibration.hasVibrator() !=null) { | ||||
|   //     //   Vibration.vibrate(duration: 100); | ||||
|   //     //   callback(); | ||||
|   //     // } | ||||
|   //   } else { | ||||
|   //     callback(); | ||||
|   //   } | ||||
|   // } | ||||
| 
 | ||||
|   // setTheme(flag) async { | ||||
|   //   storage.setItem('isTheme', flag); | ||||
|   // } | ||||
|   // | ||||
|   // isThemeEnabled() { | ||||
|   //   return storage.getItem('isTheme'); | ||||
|   // } | ||||
| 
 | ||||
|   cameraPermission() async { | ||||
|     Map<Permission, PermissionStatus> statuses = await [ | ||||
|       Permission.camera, | ||||
|     ].request(); | ||||
|   } | ||||
| 
 | ||||
|   static isCameraEnabled() async { | ||||
|     return await Permission.camera.isGranted; | ||||
|   } | ||||
| 
 | ||||
|   static isExternalStorageEnabled() async { | ||||
|     return await Permission.storage.isGranted; | ||||
|   } | ||||
| 
 | ||||
|   static isHealthDataPermissionEnabled() async { | ||||
|     return await Permission.sensors.isGranted; | ||||
|   } | ||||
| 
 | ||||
|   static isMicrophonePermissionEnabled() async { | ||||
|     return await Permission.microphone.isGranted; | ||||
|   } | ||||
| 
 | ||||
|   static isCalendarPermissionEnabled() async { | ||||
|     return await Permission.calendarFullAccess.isGranted; | ||||
|   } | ||||
| 
 | ||||
|   setCameraLocationPermission(context) async { | ||||
|     Navigator.pop(context); | ||||
|     openAppSettings(); | ||||
|   } | ||||
| 
 | ||||
|   static isLocationEnabled() async { | ||||
|     var permission = await geo.Geolocator.checkPermission(); | ||||
|     if (permission == geo.LocationPermission.denied) { | ||||
|       return false; | ||||
|     } else { | ||||
|       return true; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   openSettings() async { | ||||
|     openAppSettings(); | ||||
|   } | ||||
| 
 | ||||
|   openAccessbility() { | ||||
|     // OpenSettings.openAppSetting(); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,113 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:hmg_patient_app_new/core/app_assets.dart'; | ||||
| import 'package:hmg_patient_app_new/core/app_export.dart'; | ||||
| import 'package:hmg_patient_app_new/core/utils/utils.dart'; | ||||
| import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; | ||||
| import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; | ||||
| import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; | ||||
| 
 | ||||
| class CustomTabBarModel { | ||||
|   String? image; | ||||
|   String title; | ||||
| 
 | ||||
|   CustomTabBarModel(this.image, this.title); | ||||
| } | ||||
| 
 | ||||
| class CustomTabBar extends StatefulWidget { | ||||
|   final int initialIndex = 0; | ||||
|   final List<CustomTabBarModel> tabs; | ||||
|   final Color activeTextColor; | ||||
|   final Color activeBackgroundColor; | ||||
|   final Color inActiveTextColor; | ||||
|   final Color inActiveBackgroundColor; | ||||
|   final Function(int)? onTabChange; | ||||
| 
 | ||||
|   CustomTabBar( | ||||
|       {Key? key, | ||||
|       required this.tabs, | ||||
|       this.activeTextColor = const Color(0xff2E3039), | ||||
|       this.inActiveTextColor = const Color(0xff898A8D), | ||||
|       this.activeBackgroundColor = const Color(0x142E3039), | ||||
|       this.inActiveBackgroundColor = Colors.white, | ||||
|       this.onTabChange}) | ||||
|       : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   _CustomTabBarState createState() { | ||||
|     return _CustomTabBarState(); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class _CustomTabBarState extends State<CustomTabBar> { | ||||
|   int selectedIndex = 0; | ||||
| 
 | ||||
|   @override | ||||
|   void initState() { | ||||
|     super.initState(); | ||||
|   } | ||||
| 
 | ||||
|   @override | ||||
|   void dispose() { | ||||
|     super.dispose(); | ||||
|   } | ||||
| 
 | ||||
|   void callBackCurrentIndex() { | ||||
|     if (widget.onTabChange != null) widget.onTabChange!(selectedIndex); | ||||
|   } | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     late Widget parentWidget; | ||||
| 
 | ||||
|     if (widget.tabs.length > 3) { | ||||
|       parentWidget = ListView.separated( | ||||
|         scrollDirection: Axis.horizontal, | ||||
|         padding: EdgeInsets.zero, | ||||
|         physics: const BouncingScrollPhysics(), | ||||
|         itemBuilder: (cxt, index) => myTab(widget.tabs[index], index), | ||||
|         separatorBuilder: (cxt, index) => 4.width, | ||||
|         itemCount: widget.tabs.length, | ||||
|       ); | ||||
|     } else { | ||||
|       parentWidget = Row( | ||||
|         spacing: 4, | ||||
|         children: [for (int i = 0; i < widget.tabs.length; i++) myTab(widget.tabs[i], i).expanded], | ||||
|       ); | ||||
|     } | ||||
| 
 | ||||
|     return Container( | ||||
|         height: 62.h, | ||||
|         padding: EdgeInsets.all(4), | ||||
|         decoration: BoxDecoration( | ||||
|           color: Colors.white, | ||||
|           borderRadius: BorderRadius.circular(11), | ||||
|         ), | ||||
|         child: parentWidget); | ||||
|   } | ||||
| 
 | ||||
|   Widget myTab(CustomTabBarModel tabBar, int currentIndex) { | ||||
|     bool isSelected = selectedIndex == currentIndex; | ||||
|     return Container( | ||||
|         height: 54.h, | ||||
|         padding: EdgeInsets.only(top: 4, bottom: 4, left: 16, right: 16), | ||||
|         alignment: Alignment.center, | ||||
|         decoration: BoxDecoration( | ||||
|           color: isSelected ? widget.activeBackgroundColor : widget.inActiveBackgroundColor, | ||||
|           borderRadius: BorderRadius.circular(7), | ||||
|         ), | ||||
|         child: Row( | ||||
|           mainAxisSize: MainAxisSize.min, | ||||
|           spacing: 4, | ||||
|           children: [ | ||||
|             if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor), | ||||
|             tabBar.title | ||||
|                 .toText16(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1), | ||||
|           ], | ||||
|         )).onPress(() { | ||||
|       setState(() { | ||||
|         selectedIndex = currentIndex; | ||||
|       }); | ||||
|       callBackCurrentIndex(); | ||||
|     }); | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue