diff --git a/assets/images/new/Bottom Nav/Family Files.svg b/assets/images/new/bottom_nav/family_files.svg similarity index 100% rename from assets/images/new/Bottom Nav/Family Files.svg rename to assets/images/new/bottom_nav/family_files.svg diff --git a/assets/images/new/Bottom Nav/Help.svg b/assets/images/new/bottom_nav/help.svg similarity index 100% rename from assets/images/new/Bottom Nav/Help.svg rename to assets/images/new/bottom_nav/help.svg diff --git a/assets/images/new/Bottom Nav/Home.svg b/assets/images/new/bottom_nav/home.svg similarity index 100% rename from assets/images/new/Bottom Nav/Home.svg rename to assets/images/new/bottom_nav/home.svg diff --git a/assets/images/new/Bottom Nav/My File.svg b/assets/images/new/bottom_nav/my_file.svg similarity index 100% rename from assets/images/new/Bottom Nav/My File.svg rename to assets/images/new/bottom_nav/my_file.svg diff --git a/assets/images/new/Bottom Nav/Todo.svg b/assets/images/new/bottom_nav/todo.svg similarity index 100% rename from assets/images/new/Bottom Nav/Todo.svg rename to assets/images/new/bottom_nav/todo.svg diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 07f99b16..7c1e9e5a 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -9,8 +9,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' - as list; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -26,6 +25,7 @@ import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; +import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -50,15 +50,12 @@ class _MyFamily extends State with TickerProviderStateMixin { var userID; TabController _tabController; int _tabIndex = 0; - AuthenticatedUserObject authenticatedUserObject = - locator(); - AppointmentRateViewModel appointmentRateViewModel = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); + AppointmentRateViewModel appointmentRateViewModel = locator(); ProjectViewModel projectViewModel; AuthenticatedUser user; VitalSignService _vitalSignService = locator(); - PharmacyModuleViewModel pharmacyModuleViewModel = - locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = locator(); var isVaiable = false; @override @@ -73,24 +70,33 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget build(BuildContext context) { imagesInfo.add( ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), ); imagesInfo.add( ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), ); projectViewModel = Provider.of(context); + + if (!projectViewModel.isLogin) { + Navigator.push( + context, + MaterialPageRoute( + builder: (cxt) => NotAutPage( + title: TranslationBase.of(context).myFamilyFiles, + description: TranslationBase.of(context).familyInfo, + infoList: [], + imagesInfo: [], + icon: "assets/images/new/bottom_nav/family_files.svg", + ))); + return Container(); + } return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, + icon: "assets/images/new/bottom_nav/family_files.svg", description: TranslationBase.of(context).familyInfo, body: Scaffold( extendBodyBehindAppBar: true, @@ -105,9 +111,7 @@ class _MyFamily extends State with TickerProviderStateMixin { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), + color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), height: 70.0, ), ), @@ -119,9 +123,7 @@ class _MyFamily extends State with TickerProviderStateMixin { width: MediaQuery.of(context).size.width * 0.92, // 0.9, decoration: BoxDecoration( border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 + bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7 ), color: Colors.white), child: Center( @@ -134,8 +136,7 @@ class _MyFamily extends State with TickerProviderStateMixin { indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( @@ -165,10 +166,7 @@ class _MyFamily extends State with TickerProviderStateMixin { ? TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, - children: [ - myFamilyDetails(context), - myFamilyRequest(context) - ], + children: [myFamilyDetails(context), myFamilyRequest(context)], ) : Container(child: AppText('Loading..')), ) @@ -221,32 +219,21 @@ class _MyFamily extends State with TickerProviderStateMixin { flex: 4, child: FutureBuilder( future: getFamilyFiles(), // async work - builder: (BuildContext context, - AsyncSnapshot - snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.only(top: 50), - child: Text('Loading....')); + return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); default: if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text( - TranslationBase.of(context).noDataAvailable)); + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); else return Padding( padding: EdgeInsets.only(top: 50), child: Column(children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( - flex: 3, - child: Text( - TranslationBase.of(context).request)), + Expanded(flex: 3, child: Text(TranslationBase.of(context).request)), Expanded( flex: 2, child: Text( @@ -261,26 +248,20 @@ class _MyFamily extends State with TickerProviderStateMixin { ), Column( mainAxisAlignment: MainAxisAlignment.start, - children: snapshot - .data.getAllSharedRecordsByStatusList - .map((result) { + children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { return result.status == 3 ? Padding( padding: EdgeInsets.all(10), child: Row( children: [ - Expanded( - flex: 3, - child: Text( - result.patientName)), + Expanded(flex: 3, child: Text(result.patientName)), Expanded( flex: 2, child: IconButton( icon: Icon(Icons.group), color: Colors.black, onPressed: () { - switchUser( - result, context); + switchUser(result, context); }, )), Expanded( @@ -291,8 +272,7 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - deleteFamily( - result, context); + deleteFamily(result, context); }, )), ], @@ -314,10 +294,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Expanded( child: DefaultButton( TranslationBase.of(context).addFamilyMember, - () => { - Navigator.of(context) - .pushNamed(ADD_FAMILY_MEMBER_TYPE) - }, + () => {Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)}, color: Colors.grey[900], textColor: Colors.white, )) @@ -349,19 +326,13 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getUserViewRequest(), // async work - builder: (BuildContext context, - AsyncSnapshot snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.only(top: 50), - child: Text('Loading....')); + return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); default: if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(TranslationBase.of(context) - .noDataAvailable)); + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); else return Column( children: [ @@ -391,30 +362,19 @@ class _MyFamily extends State with TickerProviderStateMixin { // )), Column(children: [ Padding( - padding: EdgeInsets.only( - left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), child: Row(children: [ - Expanded( - flex: 3, child: AppText('Name')), - Expanded( - flex: 1, child: AppText('Allow')), - Expanded( - flex: 1, - child: AppText('Reject')), + Expanded(flex: 3, child: AppText('Name')), + Expanded(flex: 1, child: AppText('Allow')), + Expanded(flex: 1, child: AppText('Reject')), ])), Column( - children: familyFileProvider - .allSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList - .map((result) { + children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { return Padding( padding: EdgeInsets.all(10), child: Row( children: [ - Expanded( - flex: 3, - child: - Text(result.patientName)), + Expanded(flex: 3, child: Text(result.patientName)), Expanded( flex: 1, child: IconButton( @@ -423,10 +383,7 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - acceptRemoveRequest( - result.iD, - 3, - context); + acceptRemoveRequest(result.iD, 3, context); }, )), Expanded( @@ -437,10 +394,7 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - acceptRemoveRequest( - result.iD, - 4, - context); + acceptRemoveRequest(result.iD, 4, context); }, )) ], @@ -463,55 +417,32 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getSentRequest(), // async work - builder: (BuildContext context, - AsyncSnapshot - snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.only(top: 50), - child: Text('Loading....')); + return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); default: if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(TranslationBase.of(context) - .noDataAvailable)); + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); else return Container( height: SizeConfig.screenHeight * .3, child: SingleChildScrollView( child: Column( children: [ - Padding( - padding: EdgeInsets.only( - left: 10, right: 10), - child: Row(children: [ - Expanded( - flex: 3, - child: AppText( - TranslationBase.of(context) - .theName)) - ])), + Padding(padding: EdgeInsets.only(left: 10, right: 10), child: Row(children: [Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName))])), Column( - children: snapshot - .data.getAllSharedRecordsByStatusList - .map((result) { + children: snapshot.data.getAllSharedRecordsByStatusList.map((result) { return Padding( padding: EdgeInsets.all(10), child: Row( children: [ - Expanded( - flex: 3, - child: Text( - result.patientName)), + Expanded(flex: 3, child: Text(result.patientName)), Expanded( flex: 2, child: AppText( result.statusDescription, - color: result.status == 3 - ? Colors.green - : Colors.red, + color: result.status == 3 ? Colors.green : Colors.red, )), ], )); @@ -532,19 +463,13 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getUserViewRequest(), // async work - builder: (BuildContext context, - AsyncSnapshot snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.only(top: 50), - child: Text('Loading....')); + return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); default: if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(TranslationBase.of(context) - .noDataAvailable)); + return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); else return Column( children: [ @@ -573,27 +498,18 @@ class _MyFamily extends State with TickerProviderStateMixin { // )), Column(children: [ Padding( - padding: - EdgeInsets.only(left: 10, right: 10), + padding: EdgeInsets.only(left: 10, right: 10), child: Row(children: [ - Expanded( - flex: 3, child: AppText('Name')), - Expanded( - flex: 1, child: AppText('Delete')), + Expanded(flex: 3, child: AppText('Name')), + Expanded(flex: 1, child: AppText('Delete')), ])), Column( - children: familyFileProvider - .allSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList - .map((result) { + children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map((result) { return Padding( padding: EdgeInsets.all(10), child: Row( children: [ - Expanded( - flex: 3, - child: AppText( - result.patientName)), + Expanded(flex: 3, child: AppText(result.patientName)), Expanded( flex: 1, child: IconButton( @@ -602,8 +518,7 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - deactivateRequest( - result.iD, 5, context); + deactivateRequest(result.iD, 5, context); }, )), ], @@ -635,8 +550,7 @@ class _MyFamily extends State with TickerProviderStateMixin { if (user != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) { // print(await sharedPref.getObject(FAMILY_FILE)); - return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( - await sharedPref.getObject(FAMILY_FILE))); + return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE))); } else { return familyFileProvider.getSharedRecordByStatus(); } @@ -659,10 +573,7 @@ class _MyFamily extends State with TickerProviderStateMixin { confirmMessage: TranslationBase.of(context).removeFamilyMember, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => { - ConfirmDialog.closeAlertDialog(context), - removeFamily(family, context) - }, + okFunction: () => {ConfirmDialog.closeAlertDialog(context), removeFamily(family, context)}, cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -673,10 +584,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request['ID'] = this.userID; request['IsActive'] = false; - this - .familyFileProvider - .deativateActivateMemberFile(request) - .then((value) => refreshFamily(context)); + this.familyFileProvider.deativateActivateMemberFile(request).then((value) => refreshFamily(context)); } refreshFamily(context) { @@ -694,12 +602,7 @@ class _MyFamily extends State with TickerProviderStateMixin { // .then((value) => loginAfter(value, context)); // Utils.showProgressDialog(context); - this - .familyFileProvider - .silentLoggin(user is AuthenticatedUser ? null : user, - mainUser: user is AuthenticatedUser) - .then((value) => loginAfter(value, context)) - .catchError((err) { + this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { print(err); AppToast.showErrorToast(message: err); Navigator.of(context).pop(); @@ -709,8 +612,7 @@ class _MyFamily extends State with TickerProviderStateMixin { loginAfter(result, context) async { GifLoaderDialogUtils.hideDialog(context); var currentLang = await sharedPref.getString(APP_LANGUAGE); - Provider.of(context, listen: false) - .setPrivilege(privilegeList: result, isLoginChild: true); + Provider.of(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true); result = list.CheckActivationCode.fromJson(result); var familyFile = await sharedPref.getObject(FAMILY_FILE); @@ -729,14 +631,11 @@ class _MyFamily extends State with TickerProviderStateMixin { this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); await authenticatedUserObject.getUser(getUser: true); - Provider.of(context, listen: false).user = - authenticatedUserObject.user; - Provider.of(context, listen: false) - .setUser(authenticatedUserObject.user); + Provider.of(context, listen: false).user = authenticatedUserObject.user; + Provider.of(context, listen: false).setUser(authenticatedUserObject.user); await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) - await pharmacyModuleViewModel.createUser(); + if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); }); appointmentRateViewModel @@ -775,8 +674,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.deactivateFamily(request).then((value) => - {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); + this.familyFileProvider.deactivateFamily(request).then((value) => {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); } acceptRemoveRequest(ID, status, context) { @@ -784,17 +682,14 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.acceptRejectFamily(request).then((value) => - {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); + this.familyFileProvider.acceptRejectFamily(request).then((value) => {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); } checkUserData() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); - var data2 = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(MAIN_USER)); + var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); print(data2); setState(() { this.user = data; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 79bcd94b..266a0a70 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -80,6 +80,7 @@ class _ToDoState extends State { imagesInfo: imagesInfo, isShowAppBar: widget.isShowAppBar, isShowDecPage: true, + icon: "assets/images/new/bottom_nav/todo.svg", description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 2487e12d..cf91aabb 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -16,8 +16,7 @@ import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' - as family; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; @@ -63,8 +62,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { var themeNotifier; ///inject the user data - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final authService = new AuthProvider(); @@ -72,10 +70,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { var familyFileProvider = family.FamilyFilesProvider(); void _requestIOSPermissions() { - flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - IOSFlutterLocalNotificationsPlugin>() - ?.requestPermissions( + flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions( alert: true, badge: true, sound: true, @@ -86,6 +81,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { LocationUtils locationUtils; _changeCurrentTab(int tab) { + if (tab == 3) {} setState(() { currentTab = tab; if (tab != 0) @@ -107,8 +103,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(route.settings.name); } - - //setState(() { print("didChangeAppLifecycleState"); print('state = $state'); @@ -118,12 +112,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (LandingPage.isOpenCallPage) { if (!isPageNavigated) { isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { + Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { isPageNavigated = false; }); } @@ -157,16 +146,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] HMGNetworkConnectivity(context, () { GifLoaderDialogUtils.showMyDialog(context); - PlatformBridge() - .connectHMGGuestWifi() - .then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)}); }).checkAndConnectIfNoInternet(); if (Platform.isIOS) { @@ -192,7 +177,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { // if (results[Permission.calendar].isGranted) ; }); - requestPermissions(); // }); // @@ -313,16 +297,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { // ); } - - showDialogs(String message) { ConfirmDialog dialog = new ConfirmDialog( - context: context, - confirmMessage: message, - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {}, - cancelFunction: () => {}); + context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -347,8 +324,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { return permissionResults; } - static Future myBackgroundMessageHandler( - Map message) async { + static Future myBackgroundMessageHandler(Map message) async { Map myMap = new Map.from(message['data']); if (message.containsKey('data')) { print("myBackgroundMessageHandler Inside"); @@ -383,8 +359,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { void doIt() { getUserInformation().then((value) { - if (value != null) - projectViewModel.platformBridge().registerHmgGeofences(); + if (value != null) projectViewModel.platformBridge().registerHmgGeofences(); }); } @@ -406,9 +381,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { Navigator.of(context).pushNamed(CONFIRM_LOGIN); } else { GifLoaderDialogUtils.showMyDialog(context); - authService - .selectDeviceImei(DEVICE_TOKEN) - .then((SelectDeviceIMEIRES value) { + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { GifLoaderDialogUtils.hideDialog(context); if (value != null) { setUserValues(value); @@ -429,21 +402,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { getNotificationCount(token) async { if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService - .registeredAuthenticatedUser(data, token, 0, 0) - .then((res) => {print(res)}); + authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)}); authService.getDashboard().then((value) => { setState(() { - notificationCount = value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] > - 99 - ? '99+' - : value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] - .toString(); + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) @@ -461,16 +425,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { appBar: AppBar( elevation: 0, textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), + headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), ), title: Text( getText(currentTab).toUpperCase(), - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), // bold: true, // color: Colors.white, ), @@ -565,14 +524,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { index: currentTab, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: - (projectViewModel.havePrivilege(34) && currentTab == 0) - ? FloatingButton( - elevation: true, - onTap: () { - _changeCurrentTab(2); - }) - : null); + floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) + ? FloatingButton( + elevation: true, + onTap: () { + _changeCurrentTab(2); + }) + : null); } triggerRobot() { @@ -597,22 +555,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { } void checkUserStatus(token) async { - authService - .selectDeviceImei(token) - .then((SelectDeviceIMEIRES value) => setUserValues(value)); + authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); if (projectViewModel.isLoading == true) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService - .registeredAuthenticatedUser(data, token, 0, 0) - .then((res) => {print(res)}); + authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)}); authService.getDashboard().then((value) => { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] - .toString(); + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); } }) }); diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index ca72e267..a7f36b3f 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -58,8 +58,8 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final List imagesInfo; final bool isHelp; - AuthenticatedUserObject authenticatedUserObject = - locator(); + final String icon; + AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; AppScaffold( @@ -84,6 +84,7 @@ class AppScaffold extends StatelessWidget { this.appBarIcons, this.infoList, this.isHelp = false, + this.icon, this.showHomeAppBarIcon = true, this.imagesInfo}); @@ -96,8 +97,7 @@ class AppScaffold extends StatelessWidget { Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( - backgroundColor: - backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, appBar: isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -114,21 +114,20 @@ class AppScaffold extends StatelessWidget { body: SafeArea( top: true, bottom: true, - child: - (!Provider.of(context, listen: false).isLogin && - isShowDecPage) - ? NotAutPage( - title: title ?? appBarTitle, - description: description, - infoList: infoList, - imagesInfo: imagesInfo, + child: (!Provider.of(context, listen: false).isLogin && isShowDecPage) + ? NotAutPage( + title: title ?? appBarTitle, + description: description, + infoList: infoList, + imagesInfo: imagesInfo, + icon: icon, + ) + : baseViewModel != null + ? NetworkBaseView( + child: buildBodyWidget(context), + baseViewModel: baseViewModel, ) - : baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(context), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(context), + : buildBodyWidget(context), ), ); } @@ -138,14 +137,12 @@ class AppScaffold extends StatelessWidget { } buildBodyWidget(context) { - return Stack( - children: [body, isHelp == true ? RobotIcon() : Container()]); + return Stack(children: [body, isHelp == true ? RobotIcon() : Container()]); } } class AppBarWidget extends StatefulWidget with PreferredSizeWidget { - final AuthenticatedUserObject authenticatedUserObject = - locator(); + final AuthenticatedUserObject authenticatedUserObject = locator(); final String appBarTitle; final bool showHomeAppBarIcon; @@ -193,22 +190,12 @@ class AppBarWidgetState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppBar( elevation: 0, - backgroundColor: widget.isPharmacy - ? Colors.green - : Theme.of(context).appBarTheme.color, + backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), + headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), ), - title: Text( - widget.authenticatedUserObject.isLogin || !widget.isShowDecPage - ? widget.appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle, + style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack(); @@ -218,9 +205,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( - badgeContent: Text(badgeText), - child: Icon(Icons.shopping_cart)), + icon: Badge(badgeContent: Text(badgeText), child: Icon(Icons.shopping_cart)), color: Colors.white, onPressed: () { Navigator.of(context).popUntil(ModalRoute.withName('/')); @@ -232,10 +217,7 @@ class AppBarWidgetState extends State { position: BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( badgeText, - style: TextStyle( - fontSize: 9, - color: Colors.white, - fontWeight: FontWeight.normal), + style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), ), child: Icon(Icons.shopping_cart)), color: Colors.white, @@ -249,10 +231,7 @@ class AppBarWidgetState extends State { icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route r) => false); + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); // Cart Click Event if (_onCartClick != null) _onCartClick(); @@ -316,18 +295,11 @@ class _RobotIcon extends State { ], ), child: TyperAnimatedTextKit( - text: Provider.of(context, - listen: false) - .isArabic == - true + text: Provider.of(context, listen: false).isArabic == true ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", - textLength: Provider.of(context, - listen: false) - .isArabic == - true - ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - .length + textLength: Provider.of(context, listen: false).isArabic == true + ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file." .length)) : Container(), diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 88f6cfde..d247c9f5 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:provider/provider.dart'; import '../../splashPage.dart'; @@ -19,12 +20,9 @@ class NotAutPage extends StatefulWidget { final String description; final List infoList; final List imagesInfo; + final String icon; - NotAutPage( - {@required this.title, - @required this.description, - this.infoList, - this.imagesInfo}); + NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo, this.icon}); @override _NotAutPageState createState() => _NotAutPageState(); @@ -34,6 +32,70 @@ class _NotAutPageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + + return Scaffold( + backgroundColor: Color(0xfff8f8f8), + resizeToAvoidBottomPadding: false, + appBar: AppBar( + backgroundColor: Colors.transparent, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Color(0xff2B353E), + onPressed: () => Navigator.pop(context), + ), + ), + body: Padding( + padding: EdgeInsets.only(bottom: 20, left: 21, right: 21), + child: Column(children: [ + Expanded( + child: ListView( + padding: EdgeInsets.zero, + physics: BouncingScrollPhysics(), + children: [ + SizedBox(height: 12), + if (widget.icon != null) + Align( + alignment: Alignment.centerLeft, + child: SvgPicture.asset( + widget.icon, + height: 35, + width: 35, + ), + ), + SizedBox(height: 16), + Text( + widget.title, + style: TextStyle(fontSize: 24, fontFamily: "Poppins", fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), + ), + Text( + widget.description, + style: TextStyle(fontSize: 14, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + ), + ], + ), + ), + SizedBox( + height: 43, + width: double.infinity, + child: FlatButton( + onPressed: () { + loginCheck(context); + }, + child: Text( + TranslationBase.of(context).loginregister, + style: TextStyle(fontSize: 16, fontFamily: "Poppins", fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + ), + // color: Color(0xffD02127), + color: Color(0xffD02127), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + ), + ), + ]), + ), + ); + return Scaffold( body: SingleChildScrollView( padding: EdgeInsets.all(12), @@ -71,9 +133,7 @@ class _NotAutPageState extends State { Container( width: 40, height: 40, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), child: Center( child: Texts( '${index + 1}', @@ -102,26 +162,17 @@ class _NotAutPageState extends State { child: SizedBox( height: MediaQuery.of(context).size.height * 0.55, width: MediaQuery.of(context).size.width * 0.50, - child: Image.asset(projectViewModel.isArabic - ? 'assets/images/Wifi-AR.png' - : 'assets/images/wifi-EN.png'), + child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'), ), ), - if (projectViewModel.isInternetConnection && - widget.imagesInfo != null) + if (projectViewModel.isInternetConnection && widget.imagesInfo != null) CarouselSlider( items: widget.imagesInfo.map((image) { return Builder( builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset - ? Image.asset(projectViewModel.isArabic - ? image.imageAr - : image.imageEn) - : Image.network(projectViewModel.isArabic - ? image.imageAr - : image.imageEn)); + child: image.isAsset ? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); }, ); }).toList(), diff --git a/pubspec.yaml b/pubspec.yaml index f81621c7..f7064e86 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -222,6 +222,7 @@ flutter: - assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/lakum/ - assets/images/new/ + - assets/images/new/bottom_nav/ - assets/images/new/services/ fonts: