From 8626b4f2694e5d53dd05fc62393633ef8a736eda Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 15 Aug 2021 12:20:27 +0300 Subject: [PATCH 01/10] first step from add footer for all pages --- lib/pages/BookAppointment/BookingOptions.dart | 2 + lib/pages/DrawerPages/family/my-family.dart | 2 + lib/pages/ToDoList/ToDo.dart | 2 + lib/pages/landing/home_page.dart | 1 + lib/pages/landing/landing_page.dart | 180 +++++++++--------- lib/pages/medical/medical_profile_page.dart | 2 + lib/widgets/others/app_scaffold_widget.dart | 71 +++++-- 7 files changed, 153 insertions(+), 107 deletions(-) diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index 83af454f..91d90da6 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -32,6 +32,8 @@ class _BookingOptionsState extends State { return AppScaffold( isShowAppBar: widget.isAppbar, isShowDecPage: false, + isShowBottomNavBar: false, + appBarTitle: TranslationBase.of(context).bookAppo, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 7493dfc1..5f326ba6 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -92,6 +92,8 @@ class _MyFamily extends State with TickerProviderStateMixin { isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, description: TranslationBase.of(context).familyInfo, + isShowBottomNavBar: false, + body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index febbdf0f..6ef794c8 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -81,6 +81,8 @@ class _ToDoState extends State { isShowAppBar: widget.isShowAppBar, isShowDecPage: true, description: TranslationBase.of(context).infoTodo, + isShowBottomNavBar: false, + body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 8793452a..22adeec2 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -51,6 +51,7 @@ class _HomePageState extends State { builder: (_, model, wi) => AppScaffold( isShowDecPage: false, isHelp: true, + isShowBottomNavBar: false, body: Container( width: double.infinity, child: SingleChildScrollView( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index df0af1f3..d17c557b 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -32,6 +32,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:firebase_analytics/observer.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -47,8 +48,11 @@ import 'home_page.dart'; class LandingPage extends StatefulWidget { static LandingPage shared; + int currentTab = 0; _LandingPageState state; - LandingPage() { + + LandingPage({currentTabLocal}) { + currentTab = currentTabLocal ?? 0; LandingPage.shared = this; } @@ -67,7 +71,6 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); - int currentTab = 0; PageController pageController; ProjectViewModel projectViewModel; var notificationCount = ''; @@ -99,7 +102,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(int tab) { setState(() { - if (currentTab > 0 && tab == 2) + if (widget.currentTab > 0 && tab == 2) pageController.jumpToPage(0); else if (tab != 0) pageController.jumpToPage(tab); @@ -107,7 +110,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { IS_VOICE_COMMAND_CLOSED = false; pageController.jumpToPage(tab); } - currentTab = tab; + widget.currentTab = tab; }); } @@ -166,7 +169,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { AppGlobal.context = context; _requestIOSPermissions(); - pageController = PageController(keepPage: true); + pageController = + PageController(keepPage: true, initialPage: widget.currentTab); _firebaseMessaging.setAutoInitEnabled(true); locationUtils = @@ -472,94 +476,84 @@ class _LandingPageState extends State with WidgetsBindingObserver { Widget build(BuildContext context) { projectViewModel = Provider.of(context); - return Scaffold( - appBar: AppBar( - elevation: 0, - textTheme: TextTheme( - 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'), - // bold: true, - // color: Colors.white, - ), - leading: Builder( - builder: (BuildContext context) { - return new Stack( - children: [ - currentTab == 0 - ? IconButton( - icon: Icon(Icons.menu), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () => Scaffold.of(context).openDrawer(), - ) - : IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - setState(() { - currentTab = 0; - }); - - pageController.jumpToPage(0); - }, - ), - notificationCount != '' - ? new Positioned( - right: projectViewModel.isArabic ? 35 : 0, - top: 5, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - notificationCount, - style: new TextStyle( - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, - ), - textAlign: TextAlign.center, + return AppScaffold( + isShowAppBar: true, + showHomeAppBarIcon: false, + appBarTitle: getText(widget.currentTab).toUpperCase(), + leading: Builder( + builder: (BuildContext context) { + return new Stack( + children: [ + widget.currentTab == 0 + ? IconButton( + icon: Icon(Icons.menu), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () => Scaffold.of(context).openDrawer(), + ) + : IconButton( + icon: Icon(Icons.arrow_back), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () { + setState(() { + widget.currentTab = 0; + }); + + pageController.jumpToPage(0); + }, + ), + notificationCount != '' + ? new Positioned( + right: projectViewModel.isArabic ? 35 : 0, + top: 5, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectViewModel.isArabic ? 8 : 9, ), + textAlign: TextAlign.center, ), - ) - : SizedBox() - ], - ); - }, - ), - actions: [ - IconButton( - //iconSize: 70, - icon: Icon( - projectViewModel.isLogin ? Icons.settings : Icons.login, - color: Theme.of(context).textTheme.headline1.color, - ), - onPressed: () { - if (projectViewModel.isLogin) - Navigator.of(context).pushNamed( - SETTINGS, - ); - else - login(); - }, //do something, - ) - ], - centerTitle: true, + ), + ) + : SizedBox() + ], + ); + }, ), - drawer: SafeArea(child: AppDrawer()), - extendBody: true, + isShowDrawer: true, + appBarIcons: [ + IconButton( + //iconSize: 70, + icon: Icon( + projectViewModel.isLogin ? Icons.settings : Icons.login, + color: Theme.of(context).textTheme.headline1.color, + ), + onPressed: () { + if (projectViewModel.isLogin) + Navigator.of(context).pushNamed( + SETTINGS, + ); + else + login(); + }, //do something, + ) + ], + // drawer: SafeArea(child: AppDrawer()), + // extendBody: true, + isShowDecPage: false, + changeTab: changeCurrentTab, + isFromLandingPage: true, + currentTab: widget.currentTab, body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, @@ -575,13 +569,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { ToDo(isShowAppBar: false), ], // Please do not remove the BookingOptions from this array ), - bottomNavigationBar: BottomNavBar( - changeIndex: changeCurrentTab, - index: currentTab, - ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: - (projectViewModel.havePrivilege(34) && currentTab == 0) + (projectViewModel.havePrivilege(34) && widget.currentTab == 0) ? FloatingButton( elevation: true, onTap: () { diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 8d49a89b..8ba7106f 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -72,6 +72,8 @@ class _MedicalProfilePageState extends State { isShowDecPage: false, baseViewModel: model, isHelp: true, + isShowBottomNavBar: false, + body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 6a20ef3f..7f2a0f96 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -12,7 +12,9 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.da import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -44,6 +46,7 @@ class AppScaffold extends StatelessWidget { final BaseViewModel baseViewModel; final bool isBottomBar; final Widget floatingActionButton; + final FloatingActionButtonLocation floatingActionButtonLocation; final bool isPharmacy; final bool isOfferPackages; final bool showPharmacyCart; @@ -58,10 +61,19 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final List imagesInfo; final bool isHelp; + + final int currentTab; + final bool isShowBottomNavBar; + final bool isFromLandingPage; + final bool isShowDrawer; + final Function(int tab) changeTab; + final Widget leading; + AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; + AppScaffold( {@required this.body, this.appBarTitle = '', @@ -85,7 +97,14 @@ class AppScaffold extends StatelessWidget { this.infoList, this.isHelp = false, this.showHomeAppBarIcon = true, - this.imagesInfo}); + this.imagesInfo, + this.currentTab, + this.isShowBottomNavBar = true, + this.isFromLandingPage = false, + this.changeTab, + this.floatingActionButtonLocation, + this.leading, + this.isShowDrawer = false}); AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; @@ -98,6 +117,7 @@ class AppScaffold extends StatelessWidget { return Scaffold( backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, + drawer: isShowDrawer ? SafeArea(child: AppDrawer()) : null, appBar: isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -108,9 +128,16 @@ class AppScaffold extends StatelessWidget { isOfferPackages: isOfferPackages, showOfferPackagesCart: showOfferPackagesCart, isShowDecPage: isShowDecPage, + leading: leading, ) : null, bottomSheet: bottomSheet, + bottomNavigationBar: isShowBottomNavBar + ? BottomNavBar( + changeIndex: changeCurrentTab, + index: currentTab, + ) + : null, body: SafeArea( top: true, bottom: true, @@ -131,6 +158,7 @@ class AppScaffold extends StatelessWidget { : buildBodyWidget(context), ), floatingActionButton: floatingActionButton, + floatingActionButtonLocation: floatingActionButtonLocation, ); } @@ -142,6 +170,20 @@ class AppScaffold extends StatelessWidget { return Stack( children: [body, isHelp == true ? RobotIcon() : Container()]); } + + void changeCurrentTab(int value) { + if (isFromLandingPage) { + changeTab(value); + // call the nav funcion + } else { + // navigate to langing page with index + Navigator.pushAndRemoveUntil( + AppGlobal.context, + MaterialPageRoute( + builder: (context) => LandingPage(currentTabLocal: value)), + (Route r) => false); + } + } } class AppBarWidget extends StatefulWidget with PreferredSizeWidget { @@ -159,6 +201,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { Function(String) badgeUpdater; + final Widget leading; + AppBarWidget( {this.appBarTitle, this.showHomeAppBarIcon, @@ -167,7 +211,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { this.showPharmacyCart = true, this.isOfferPackages = false, this.showOfferPackagesCart = false, - this.isShowDecPage = true}); + this.isShowDecPage = true, + this.leading}); @override State createState() => AppBarWidgetState(); @@ -178,6 +223,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { class AppBarWidgetState extends State { String badgeText = "0"; + @override Widget build(BuildContext context) { widget.badgeUpdater = badgeUpdateBlock; @@ -210,11 +256,12 @@ class AppBarWidgetState extends State { fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), + leading: widget.leading ?? + Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), centerTitle: true, actions: [ (widget.isPharmacy && widget.showPharmacyCart) @@ -364,10 +411,10 @@ class _RobotIcon extends State { bottom: -15); } - // setAnimation() async { - // /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || - // // var animation = - // // IS_TEXT_COMPLETED == ? true : false; +// setAnimation() async { +// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || +// // var animation = +// // IS_TEXT_COMPLETED == ? true : false; - // } +// } } From 69df61afb170a133a06b3bc3d67ba0a52dc3de97 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 17 Aug 2021 14:49:25 +0300 Subject: [PATCH 02/10] remove footer from pharmacy pages --- .../ContactUs/LiveChat/livechat_page.dart | 1 + lib/pages/ContactUs/findus/findus_page.dart | 1 + lib/pages/feedback/feedback_home_page.dart | 1 + lib/pages/landing/landing_page_pharmcy.dart | 29 ------------------- lib/pages/login/confirm-login.dart | 1 + lib/pages/login/forgot-password.dart | 1 + lib/pages/login/login-type.dart | 1 + lib/pages/login/login.dart | 1 + lib/pages/login/register-info.dart | 1 + lib/pages/login/register.dart | 1 + lib/pages/login/welcome.dart | 1 + .../prescriptions_home_page.dart | 1 + .../screens/pharmacy_module_page.dart | 1 + lib/pages/pharmacy_categorise.dart | 1 + lib/widgets/others/app_scaffold_widget.dart | 10 +++++-- 15 files changed, 20 insertions(+), 32 deletions(-) diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index a747db3d..2b43f347 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -45,6 +45,7 @@ class _LiveChatPageState extends State title: TranslationBase.of(context).liveChat, description: TranslationBase.of(context).infoChat, appBarTitle: TranslationBase.of(context).service, + isShowBottomNavBar: false, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 80648292..a01e2fd5 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -39,6 +39,7 @@ class _FindUsPageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, appBarTitle: 'Locations', baseViewModel: model, body: Scaffold( diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index f7f998bf..0c6fb834 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -36,6 +36,7 @@ class _FeedbackHomePageState extends State isShowAppBar: true, isBottomBar: false, isShowDecPage: false, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).feedbackTitle, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index 04c9bb54..e087a87e 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -110,35 +110,6 @@ class _LandingPagePharmacyState extends State { centerTitle: true, ) : null, - // : AppBar( - // backgroundColor: Color(0xff5AB145), - // elevation: 0, - // textTheme: TextTheme( - // headline6: TextStyle( - // color: Colors.white, fontWeight: FontWeight.bold), - // ), - // title: Text(getText(currentTab).toUpperCase()), - // leading: Builder( - // builder: (BuildContext context) { - // return IconButton( - // icon: Icon(Icons.arrow_back), - // color: Colors.white, - // onPressed: () => Scaffold.of(context).openDrawer(), - // ); - // }, - // ), - // actions: [ - // // IconButton( - // // iconSize: 70, - // // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', - // // height: 100, width: 100, fit: BoxFit.cover), - // // onPressed: () { - // // triggerRobot(); - // // } //do something, - // // ) - // ], - // centerTitle: true, - // ), extendBody: false, body: PageView( physics: NeverScrollableScrollPhysics(), diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index bcbcf6cb..d8639a6a 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -101,6 +101,7 @@ class _ConfirmLogin extends State { appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(20), diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index d6478c92..fc21b0e1 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -31,6 +31,7 @@ class _ForgotPassword extends State { appBarTitle: TranslationBase.of(context).forgotFileNoTitle, isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index f8af8eac..18a3da8b 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -21,6 +21,7 @@ class LoginType extends StatelessWidget { appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 1c0fd13e..295b2cf2 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -80,6 +80,7 @@ class _Login extends State { appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index d28fea86..9d953161 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -60,6 +60,7 @@ class _RegisterInfo extends State { appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, body: SingleChildScrollView( padding: EdgeInsets.all(20), child: Column(children: [ diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 1591d1d5..6fc31d4a 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -49,6 +49,7 @@ class _Register extends State { appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 6a007e0a..761d4df3 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -30,6 +30,7 @@ class _WelcomeLogin extends State { appBarTitle: TranslationBase.of(context).welcome, isShowDecPage: false, isShowAppBar: true, + isShowBottomNavBar: false, body: Padding( padding: EdgeInsets.all(20), child: Column( diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 380d6284..29a6e0cb 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -47,6 +47,7 @@ class _HomePrescriptionsPageState extends State description: TranslationBase.of(context).infoPrescriptions, infoList: TranslationBase.of(context).infoPrescriptionsPoints, imagesInfo: imagesInfo, + isShowBottomNavBar: false, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index e4830583..bdb508bc 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -80,6 +80,7 @@ class _PharmacyPageState extends State { isShowAppBar: false, isShowDecPage: false, baseViewModel: model, + isPharmacy:true, backgroundColor: Colors.white, body: Container( width: double.infinity, diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index ff1920dc..64b6bf6a 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -35,6 +35,7 @@ class _PharmacyCategorisePageState extends State { AppScaffold( isShowDecPage: false, baseViewModel: model, + isPharmacy:true, body: Column( children: [ Expanded( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 7f2a0f96..3d6e65e1 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -132,7 +132,7 @@ class AppScaffold extends StatelessWidget { ) : null, bottomSheet: bottomSheet, - bottomNavigationBar: isShowBottomNavBar + bottomNavigationBar: isShowBottomNavBar && !getIsShowDecPageValue(context) && !isPharmacy ? BottomNavBar( changeIndex: changeCurrentTab, index: currentTab, @@ -142,8 +142,7 @@ class AppScaffold extends StatelessWidget { top: true, bottom: true, child: - (!Provider.of(context, listen: false).isLogin && - isShowDecPage) + getIsShowDecPageValue(context) ? NotAutPage( title: title ?? appBarTitle, description: description, @@ -162,6 +161,11 @@ class AppScaffold extends StatelessWidget { ); } + + getIsShowDecPageValue(context){ + return (!Provider.of(context, listen: false).isLogin && + isShowDecPage); + } buildAppLoaderWidget(bool isLoading) { return isLoading ? AppLoaderWidget() : Container(); } From d028ce22dc2d33a9b40459163fb2468a2691e5cb Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 17 Aug 2021 15:21:19 +0300 Subject: [PATCH 03/10] remove unused code --- .../home_health_care_index_page.dart | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart deleted file mode 100644 index fa0799f9..00000000 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import 'home_health_care_page.dart'; - -class HomeHealthCareIndexPage extends StatelessWidget { - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).serviceInformation, - body: SingleChildScrollView( - padding: EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).homeHealthCare, - fontWeight: FontWeight.normal, - fontSize: 25, - color: Color(0xff60686b), - ), - SizedBox( - height: 12, - ), - Texts( - TranslationBase.of(context).homeHealthCareText, - fontWeight: FontWeight.normal, - fontSize: 17, - ), - SizedBox( - height: 22, - ), - Center( - child: Image.asset( - 'assets/images/AlHabibMedicalService/Wifi-AR.png')), - SizedBox( - height: 77, - ), - ], - )), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - onTap: () => Navigator.push( - context, - FadePage( - page: HomeHealthCarePage(), - ), - ), - label: TranslationBase.of(context).loginRegister, - textColor: Theme.of(context).backgroundColor), - ), - ], - ), - )); - } -} From ab2fc6aa2cdf00de92543276d6f1a7689af223b2 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Thu, 19 Aug 2021 16:00:12 +0300 Subject: [PATCH 04/10] fix issues related to footer --- .../NewCMC/new_cmc_step_one_page.dart | 1 + .../NewCMC/new_cmc_step_three_page.dart | 1 + .../NewCMC/new_cmc_step_tow_page.dart | 1 + .../orders_log_details_page.dart | 1 + .../new_e_referral_step_one_page.dart | 1 + .../new_e_referral_step_three_page.dart | 1 + .../new_e_referral_step_two_page.dart | 1 + .../E-Referral/e_referral_page.dart | 1 + .../E-Referral/search_for_referrals_page.dart | 1 + .../new_Home_health_care_step_one_page.dart | 1 + .../new_Home_health_care_step_three_page.dart | 1 + .../new_Home_health_care_step_tow_page.dart | 1 + .../orders_log_details_page.dart | 1 + .../all_habib_medical_service_page.dart | 2 +- .../h2o/h2o_index_page.dart | 1 + .../AlHabibMedicalService/h2o/h2o_page.dart | 1 + .../AlHabibMedicalService/h2o/month_page.dart | 2 + .../AlHabibMedicalService/h2o/today_page.dart | 1 + .../AlHabibMedicalService/h2o/week_page.dart | 1 + lib/pages/BookAppointment/DoctorProfile.dart | 1 + .../ContactUs/LiveChat/livechat_page.dart | 2 +- lib/pages/DrawerPages/family/my-family.dart | 7 ++- lib/pages/ErService/AmbulanceReq.dart | 1 + .../MyAppointments/AppointmentDetails.dart | 1 + lib/pages/MyAppointments/MyAppointments.dart | 1 + lib/pages/livecare/livecare_home.dart | 1 + .../ask_doctor/ask_doctor_home_page.dart | 1 + lib/pages/medical/eye/EyeHomePage.dart | 1 + lib/pages/medical/medical_profile_page.dart | 9 +++- .../my_trackers/Weight/WeightHomePage.dart | 44 ++++++++++--------- .../blood_pressure/BloodPressureHomePage.dart | 30 +++++++------ .../blood_suger/blood_sugar_home_page.dart | 30 +++++++------ .../medical/reports/report_home_page.dart | 1 + .../smart_watch_health_data/stepsTracker.dart | 1 + lib/widgets/others/app_scaffold_widget.dart | 3 +- 35 files changed, 101 insertions(+), 54 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index c07b8345..fb41e39a 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -40,6 +40,7 @@ class _NewCMCStepOnePageState extends State { return AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, baseViewModel: widget.model, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index 75699a5c..a5dcf998 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -65,6 +65,7 @@ class _NewCMCStepThreePageState extends State { return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 3d969d9e..3a0f35ff 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -71,6 +71,7 @@ class _NewCMCStepTowPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, + isShowBottomNavBar: false, body: Stack( children: [ PlacePicker( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index ec686e70..c6a09c3c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -51,6 +51,7 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 5a3271f2..2bf6427e 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -93,6 +93,7 @@ class _NewEReferralStepOnePageState extends State { onModelReady: (model) => model.getRelationTypes(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index a823c154..c377148f 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -52,6 +52,7 @@ class _NewEReferralStepThreePageState extends State { return BaseView( builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 5f85fe12..2b27cc7a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -60,6 +60,7 @@ class _NewEReferralStepTowPageState extends State { onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index 9007229a..ddb374fb 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -38,6 +38,7 @@ class _EReferralPageState extends State return BaseView( builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + appBarTitle: TranslationBase.of(context).ereferral, description: TranslationBase.of(context).eReferralInfo, imagesInfo: [ diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 0b75705d..0d77ff24 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -47,6 +47,7 @@ class _SearchForReferralsPageState extends State { onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 86ee791b..5503895a 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -52,6 +52,7 @@ class _NewHomeHealthCareStepOnePageState return AppScaffold( isShowAppBar: false, baseViewModel: widget.model, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index 5e9bd04d..210345cb 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -71,6 +71,7 @@ class _NewHomeHealthCareStepThreePageState return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index e9ddd2d1..4dfffa82 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -74,6 +74,7 @@ class _NewHomeHealthCareStepTowPageState ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, + isShowBottomNavBar: false, body: Stack( children: [ PlacePicker( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index f0ca5fe4..79d037f5 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -51,6 +51,7 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, + isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index d6a60e3d..43eeedfa 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -169,7 +169,7 @@ class _AllHabibMedicalServiceState extends State { Navigator.push( context, FadePage( - page: MedicalProfilePage(), + page: MedicalProfilePage(isFromAllServicePage: true), ), ); }, diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index e6e05ee6..09dbc4e3 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -13,6 +13,7 @@ class H2OPageIndexPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + //isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).serviceInformation, body: SingleChildScrollView( padding: EdgeInsets.all(12), diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index b847190f..49e5c8db 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -48,6 +48,7 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { onModelReady: (model) => model.getUserDetail(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).waterTracker, showHomeAppBarIcon: false, baseViewModel: model, diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index 8867fb77..e65bef82 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -19,6 +19,8 @@ class MonthPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForMonthData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, + appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 03d11f50..e8e15a83 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -22,6 +22,7 @@ class TodayPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: SingleChildScrollView( diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index 6f4423b2..0c9691c4 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -19,6 +19,7 @@ class WeekPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForWeekData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 949f2c44..5485b9c9 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -68,6 +68,7 @@ class _DoctorProfileState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, + isShowBottomNavBar: false, isShowDecPage: false, bottomSheet: showFooterButton ? Container( diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index 2b43f347..f2485cb6 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -41,11 +41,11 @@ class _LiveChatPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + isShowBottomNavBar: false, imagesInfo: imagesInfo, title: TranslationBase.of(context).liveChat, description: TranslationBase.of(context).infoChat, appBarTitle: TranslationBase.of(context).service, - isShowBottomNavBar: false, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 5f326ba6..0dfbd429 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -38,7 +38,10 @@ import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; - MyFamily({this.isAppbarVisible = true}); + + final bool isFromAllServicePage; + + MyFamily({this.isAppbarVisible = true, this.isFromAllServicePage = false}); @override _MyFamily createState() => _MyFamily(); } @@ -92,7 +95,7 @@ class _MyFamily extends State with TickerProviderStateMixin { isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, description: TranslationBase.of(context).familyInfo, - isShowBottomNavBar: false, + isShowBottomNavBar: widget.isFromAllServicePage, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 1d4e78ee..72e775e3 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -51,6 +51,7 @@ class _AmbulanceReqState extends State onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).transportationService, description: TranslationBase.of(context).infoAmbulance, imagesInfo: imagesInfo, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 68781795..09e39de3 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -56,6 +56,7 @@ class _AppointmentDetailsState extends State return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, + isShowBottomNavBar: false, bottomSheet: AppointmentDetails.showFooterButton ? Container( width: MediaQuery.of(context).size.width, diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 5ed0fef4..594fece0 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -76,6 +76,7 @@ class _MyAppointmentsState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, + isShowBottomNavBar: false, imagesInfo: imagesInfo, description: TranslationBase.of(context).infoMyAppointments, body: Container( diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index d74dd6c8..403acf0c 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -51,6 +51,7 @@ class _LiveCareHomeState extends State return AppScaffold( appBarTitle: "LiveCare", isShowAppBar: true, + isShowBottomNavBar: false, imagesInfo: imagesInfo, description: TranslationBase.of(context).erConsultation, body: Container( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 902225b1..770e5ca1 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -39,6 +39,7 @@ class _AskDoctorHomPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).askDoctor, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 3af2279e..3af45f25 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -44,6 +44,7 @@ class _EyeHomePageState extends State return AppScaffold( isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).measurements, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 8ba7106f..071c0298 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -48,6 +48,10 @@ import 'labs/labs_home_page.dart'; import 'my_trackers/my_trackers.dart'; class MedicalProfilePage extends StatefulWidget { + + final bool isFromAllServicePage; + + const MedicalProfilePage({ this.isFromAllServicePage = false}) ; @override _MedicalProfilePageState createState() => _MedicalProfilePageState(); } @@ -60,6 +64,7 @@ class _MedicalProfilePageState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList( projectViewModel: projectViewModel, @@ -68,11 +73,11 @@ class _MedicalProfilePageState extends State { isLogin: projectViewModel.isLogin); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), - builder: (_, model, widget) => AppScaffold( + builder: (_, model, x) => AppScaffold( isShowDecPage: false, baseViewModel: model, isHelp: true, - isShowBottomNavBar: false, + isShowBottomNavBar: widget.isFromAllServicePage, body: Container( child: SingleChildScrollView( diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 41592110..5a15908b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -42,6 +42,7 @@ class _WeightHomePageState extends State with SingleTickerProvid builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).weight, appBarIcons: [ IconButton( @@ -100,26 +101,29 @@ class _WeightHomePageState extends State with SingleTickerProvid ) ], ), - floatingActionButton: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddWeightPage( - model: model, - ))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, + floatingActionButton: Container( + margin: EdgeInsets.only(bottom: 70), + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddWeightPage( + model: model, + ))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).primaryColor, + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index 723871cb..30414245 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -42,6 +42,7 @@ class _BloodPressureHomePageState extends State onModelReady: (model) => model.getBloodPressure(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).bloodPressure, baseViewModel: model, appBarIcons: [IconButton( @@ -94,19 +95,22 @@ class _BloodPressureHomePageState extends State ) ], ), - floatingActionButton: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, color: Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, + floatingActionButton: Container( + margin: EdgeInsets.only(bottom: 70), + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 29989e53..48f6b9d2 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -47,6 +47,7 @@ class _BloodSugarHomePageState extends State return BaseView( onModelReady: (model) => model.getBloodSugar(), builder: (_, model, w) => AppScaffold( + isShowBottomNavBar: false, appBarIcons: [IconButton( icon: Icon(Icons.email), color: Colors.white, @@ -105,19 +106,22 @@ class _BloodSugarHomePageState extends State ) ], ), - floatingActionButton: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, color:Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, + floatingActionButton: Container( + margin: EdgeInsets.only(bottom: 70), + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color:Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), ), diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index f9efb1a1..fb6a729c 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -59,6 +59,7 @@ class _HomeReportPageState extends State onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, + isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).newMedReport, title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, diff --git a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart index 3fe1a4ba..d1b6607c 100644 --- a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart @@ -44,6 +44,7 @@ class _StepsTrackerState extends State isShowAppBar: true, appBarTitle: "Steps", isShowDecPage: false, + isShowBottomNavBar: false, body: Container( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 3d6e65e1..ffd23bfd 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -178,9 +178,7 @@ class AppScaffold extends StatelessWidget { void changeCurrentTab(int value) { if (isFromLandingPage) { changeTab(value); - // call the nav funcion } else { - // navigate to langing page with index Navigator.pushAndRemoveUntil( AppGlobal.context, MaterialPageRoute( @@ -407,6 +405,7 @@ class _RobotIcon extends State { ))) : Container(), FloatingSearchButton() + ], ) ], From 1fefbfb76e45051eb5b7dd303259fb689f393535 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 22 Aug 2021 10:41:17 +0300 Subject: [PATCH 05/10] return bottom sheet inside appointments list --- lib/pages/MyAppointments/MyAppointments.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 594fece0..5ed0fef4 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -76,7 +76,6 @@ class _MyAppointmentsState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, - isShowBottomNavBar: false, imagesInfo: imagesInfo, description: TranslationBase.of(context).infoMyAppointments, body: Container( From 73097d15de537323b730f77aeb89494454f53566 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 24 Aug 2021 16:12:31 +0300 Subject: [PATCH 06/10] Covid Lab result generate certificate implemented --- lib/config/localized_values.dart | 1 + lib/core/model/labs/lab_result.dart | 85 ++++++++------ lib/core/service/medical/labs_service.dart | 70 +++++++----- lib/uitl/translations_delegate_base.dart | 2 + .../medical/LabResult/LabResultWidget.dart | 106 +++++++++++++----- .../LabResult/laboratory_result_widget.dart | 3 +- lib/widgets/in_app_browser/InAppBrowser.dart | 20 ++-- 7 files changed, 186 insertions(+), 101 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5a1df0a3..50eae821 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1345,4 +1345,5 @@ const Map localizedValues = { "book-video-livecare-2": {"en": "I don't need to visit the clinic", "ar": "اتصال فيديو لا احتاج الحضور الى العيادة"}, "no-thankyou": {"en": "No Thanks", "ar": "لا شكرا"}, "visit-clinic": {"en": "Schedule appointment with the doctor", "ar": "ارغب في حجز موعد مجدول مع الطبيب"}, + "generate-covid-certificate": {"en": "Generate Covid-19 Certificate", "ar": "إنشاء شهادة كورونا"}, }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index 2deb13f3..739adf01 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,57 +1,81 @@ +class LabResultList { + String filterName = ""; + List patientLabResultList = List(); + + LabResultList({this.filterName, LabResult lab}) { + patientLabResultList.add(lab); + } +} + class LabResult { String description; - dynamic femaleInterpretativeData; + Null femaleInterpretativeData; int gender; + bool isCertificateAllowed; int lineItemNo; - dynamic maleInterpretativeData; - String notes; + Null maleInterpretativeData; + Null notes; + int orderLineItemNo; + int orderNo; String packageID; int patientID; String projectID; String referanceRange; String resultValue; + int resultValueBasedLineItemNo; + String resultValueFlag; String sampleCollectedOn; String sampleReceivedOn; String setupID; - dynamic superVerifiedOn; + Null superVerifiedOn; String testCode; String uOM; String verifiedOn; - dynamic verifiedOnDateTime; + Null verifiedOnDateTime; LabResult( {this.description, - this.femaleInterpretativeData, - this.gender, - this.lineItemNo, - this.maleInterpretativeData, - this.notes, - this.packageID, - this.patientID, - this.projectID, - this.referanceRange, - this.resultValue, - this.sampleCollectedOn, - this.sampleReceivedOn, - this.setupID, - this.superVerifiedOn, - this.testCode, - this.uOM, - this.verifiedOn, - this.verifiedOnDateTime}); + this.femaleInterpretativeData, + this.gender, + this.isCertificateAllowed, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.orderLineItemNo, + this.orderNo, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.resultValueBasedLineItemNo, + this.resultValueFlag, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); LabResult.fromJson(Map json) { description = json['Description']; femaleInterpretativeData = json['FemaleInterpretativeData']; gender = json['Gender']; + isCertificateAllowed = json['IsCertificateAllowed']; lineItemNo = json['LineItemNo']; maleInterpretativeData = json['MaleInterpretativeData']; notes = json['Notes']; + orderLineItemNo = json['OrderLineItemNo']; + orderNo = json['OrderNo']; packageID = json['PackageID']; patientID = json['PatientID']; projectID = json['ProjectID']; referanceRange = json['ReferanceRange']; resultValue = json['ResultValue']; + resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo']; + resultValueFlag = json['ResultValueFlag']; sampleCollectedOn = json['SampleCollectedOn']; sampleReceivedOn = json['SampleReceivedOn']; setupID = json['SetupID']; @@ -67,14 +91,19 @@ class LabResult { data['Description'] = this.description; data['FemaleInterpretativeData'] = this.femaleInterpretativeData; data['Gender'] = this.gender; + data['IsCertificateAllowed'] = this.isCertificateAllowed; data['LineItemNo'] = this.lineItemNo; data['MaleInterpretativeData'] = this.maleInterpretativeData; data['Notes'] = this.notes; + data['OrderLineItemNo'] = this.orderLineItemNo; + data['OrderNo'] = this.orderNo; data['PackageID'] = this.packageID; data['PatientID'] = this.patientID; data['ProjectID'] = this.projectID; data['ReferanceRange'] = this.referanceRange; data['ResultValue'] = this.resultValue; + data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo; + data['ResultValueFlag'] = this.resultValueFlag; data['SampleCollectedOn'] = this.sampleCollectedOn; data['SampleReceivedOn'] = this.sampleReceivedOn; data['SetupID'] = this.setupID; @@ -86,13 +115,3 @@ class LabResult { return data; } } - - -class LabResultList { - String filterName = ""; - List patientLabResultList = List(); - - LabResultList({this.filterName, LabResult lab}) { - patientLabResultList.add(lab); - } -} diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 11592956..1d88782d 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -3,21 +3,18 @@ import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; -import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class LabsService extends BaseService { List patientLabOrdersList = List(); Future getPatientLabOrdersList() async { hasError = false; - Map body = Map(); + Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_Patient_LAB_ORDERS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_Patient_LAB_ORDERS, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList.clear(); response['ListPLO'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); @@ -28,26 +25,20 @@ class LabsService extends BaseService { }, body: body); } - RequestPatientLabSpecialResult _requestPatientLabSpecialResult = - RequestPatientLabSpecialResult(); + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); List patientLabSpecialResult = List(); List labResultList = List(); List labOrdersResultsList = List(); - Future getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo}) async { + Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo}) async { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.orderNo = orderNo; - await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); @@ -67,8 +58,7 @@ class LabsService extends BaseService { body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; - await baseAppClient.post(GET_Patient_LAB_RESULT, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_Patient_LAB_RESULT, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); labResultList.clear(); response['ListPLR'].forEach((lab) { @@ -80,7 +70,33 @@ class LabsService extends BaseService { }, body: body); } - Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + Future generateCovidLabReport(LabResult covidLabResult) async { + hasError = false; + Map body = Map(); + + body['To'] = user.emailAddress; + body['OrderNo'] = covidLabResult.orderNo; + body['OrderLineItemNo'] = covidLabResult.orderLineItemNo; + body['LineItemNo'] = covidLabResult.resultValueBasedLineItemNo; + body['CertificateFormat'] = 5; + body['GeneratedBy'] = 102; + body['ShowPassportNumber'] = "no"; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = covidLabResult.setupID; + body['ProjectID'] = covidLabResult.projectID; + + dynamic localRes; + + await baseAppClient.post(SEND_COVID_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return Future.value(localRes); + } + + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { hasError = false; Map body = Map(); body['InvoiceNo'] = patientLabOrder.invoiceNo; @@ -90,9 +106,8 @@ class LabsService extends BaseService { body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; - await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, - onSuccess: (dynamic response, int statusCode) { - labOrdersResultsList.clear(); + await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { + labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); }); @@ -102,28 +117,23 @@ class LabsService extends BaseService { }, body: body); } - RequestSendLabReportEmail _requestSendLabReportEmail = - RequestSendLabReportEmail(); + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; - _requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName; - _requestSendLabReportEmail.patientIditificationNum = - user.patientIdentificationNo; + _requestSendLabReportEmail.patientName = user.firstName + " " + user.lastName; + _requestSendLabReportEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendLabReportEmail.dateofBirth = user.dateofBirth; _requestSendLabReportEmail.to = user.emailAddress; _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; _requestSendLabReportEmail.patientMobileNumber = user.mobileNumber; _requestSendLabReportEmail.projectName = patientLabOrder.projectName; - _requestSendLabReportEmail.setupID = user.setupID; - - await baseAppClient.post(SEND_LAB_RESULT_EMAIL, - onSuccess: (dynamic response, int statusCode) { + _requestSendLabReportEmail.setupID = user.setupID; - }, onFailure: (String error, int statusCode) { + await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _requestSendLabReportEmail.toJson()); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f0d2b243..b32f1c8b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1217,6 +1217,8 @@ class TranslationBase { String get bookVideoLivecare2 => localizedValues["book-video-livecare-2"][locale.languageCode]; String get noThankyou => localizedValues["no-thankyou"][locale.languageCode]; String get visitClinic => localizedValues["visit-clinic"][locale.languageCode]; + String get generateCovidCertificate => localizedValues["generate-covid-certificate"][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index ea2ede44..8b277cc2 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -1,7 +1,11 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -10,15 +14,17 @@ import 'package:provider/provider.dart'; import '../../text.dart'; import 'FlowChartPage.dart'; - class LabResultWidget extends StatelessWidget { + final String filterName; - final String filterName ; final List patientLabResultList; final PatientLabOrders patientLabOrder; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); + LabResult covidLabResult; + + LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -29,8 +35,7 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts(filterName), InkWell( @@ -40,7 +45,7 @@ class LabResultWidget extends StatelessWidget { FadePage( page: FlowChartPage( filterName: filterName, - patientLabOrder: patientLabOrder, + patientLabOrder: patientLabOrder, ), ), ); @@ -55,16 +60,76 @@ class LabResultWidget extends StatelessWidget { ), Table( border: TableBorder.symmetric( - inside: BorderSide( - width: 2.0, color: Colors.grey[300]), + inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(patientLabResultList,context), + children: fullData(patientLabResultList, context), ), + checkIfCovidLab(patientLabResultList) + ? Container( + margin: EdgeInsets.only(top: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.91, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.red[300], + onPressed: () { + showConfirmMessage(context, projectViewModel.user.emailAddress); + }, + child: Text(TranslationBase.of(context).generateCovidCertificate, style: TextStyle(fontSize: 18.0)), + ), + ), + ) + : Container(), ], ), ); } - List fullData(List labResultList,context) { + + generateCovidCertificate(BuildContext context) { + LabsService service = new LabsService(); + GifLoaderDialogUtils.showMyDialog(context); + + service.generateCovidLabReport(covidLabResult).then((res) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + void showConfirmMessage(BuildContext context, String email) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: email, + onTapSendEmail: () { + generateCovidCertificate(context); + }, + ), + ); + } + + bool checkIfCovidLab(List labResultList) { + bool isCovidResult = false; + labResultList.forEach((order) { + if (order.testCode.toUpperCase().contains("COVID") && order.isCertificateAllowed.toString() == "true") { + isCovidResult = true; + covidLabResult = order; + } + print(covidLabResult.testCode); + }); + + return isCovidResult; + } + + List fullData(List labResultList, context) { List tableRow = []; tableRow.add( TableRow( @@ -74,12 +139,8 @@ class LabResultWidget extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - topRight: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), + topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), ), ), child: Center( @@ -106,12 +167,8 @@ class LabResultWidget extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), + topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), ), ), child: Center( @@ -144,7 +201,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: Texts( - lab.resultValue+" "+lab.uOM, + lab.resultValue + " " + lab.uOM, textAlign: TextAlign.center, ), ), @@ -168,7 +225,4 @@ class LabResultWidget extends StatelessWidget { }); return tableRow; } - } - - diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 7b49559c..4635d3fa 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -188,7 +188,7 @@ class _LaboratoryResultWidgetState extends State { .labResultLists[index] .patientLabResultList, ), - ) + ), ], ), ), @@ -252,7 +252,6 @@ class _LaboratoryResultWidgetState extends State { data: widget.details ?? TranslationBase.of(context).noDataAvailable, )), ), - ], ), ], diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e66b2eae..435e4368 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -23,23 +23,23 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - // static String SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + // static String PREAUTH_SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static String PRESCRIPTION_PAYMENT_WITH_ORDERID = - 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live + 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; + + // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = + // 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live // Packages static String PACKAGES_REQUEST_PAYMENT_URL = From d33432d2380fe9cab22ee9a2c86a4811125e5b80 Mon Sep 17 00:00:00 2001 From: Zohaib Iqbal Kambrani <> Date: Tue, 24 Aug 2021 17:59:48 +0300 Subject: [PATCH 07/10] Covid Drive-Thru Questions Screen --- assets/json/covid-drive-thru-question.json | 85 +++++++++ ios/Flutter/.last_build_id | 2 +- ios/Podfile.lock | 65 ++++++- ios/Runner.xcodeproj/project.pbxproj | 18 ++ lib/config/localized_values.dart | 4 + .../covid-dirvethru-questions.dart | 165 ++++++++++++++++++ .../covid-drivethru-location.dart | 6 +- lib/uitl/app_toast.dart | 6 +- lib/uitl/translations_delegate_base.dart | 5 + 9 files changed, 343 insertions(+), 13 deletions(-) create mode 100644 assets/json/covid-drive-thru-question.json create mode 100644 lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart diff --git a/assets/json/covid-drive-thru-question.json b/assets/json/covid-drive-thru-question.json new file mode 100644 index 00000000..626d702a --- /dev/null +++ b/assets/json/covid-drive-thru-question.json @@ -0,0 +1,85 @@ +[ + { + "id": 1, + "questionEN": "Is the test intended for travel?", + "questionAR": "هل تجري التحليل بغرض السفر؟", + "ans": 2 + }, + { + "id": 2, + "questionEN": "Coming from outside KSA within last 2 weeks?", + "questionAR": "هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟", + "ans": 2 + }, + { + "id": 3, + "questionEN": "Do you currently have fever?", + "questionAR": "هل تعاني حاليا من حرارة؟", + "ans": 2 + }, + { + "id": 4, + "questionEN": "Did you have fever in last 2 weeks?", + "questionAR": "هل عانيت من حرارة في الأسبوعين الماضيين؟", + "ans": 2 + }, + { + "id": 5, + "questionEN": "Do you have a sore throat?", + "questionAR": "هل لديك التهاب في الحلق؟", + "ans": 2 + }, + { + "id": 6, + "questionEN": "Do you have a runny nose?", + "questionAR": "هل لديك سيلان بالأنف؟" + }, + { + "id": 7, + "questionEN": "Do you have a cough?", + "questionAR": "هل لديك سعال؟", + "ans": 2 + }, + { + "id": 8, + "questionEN": "Do you have shortness of breath?", + "questionAR": "هل تعانين من ضيق في التنفس؟", + "ans": 2 + }, + { + "id": 9, + "questionEN": "Do you have nausea?", + "questionAR": "هل تعانين من غثيان؟", + "ans": 2 + }, + { + "id": 10, + "questionEN": "Do you have vomiting?", + "questionAR": "هل تعاني من القيء؟", + "ans": 2 + }, + { + "id": 11, + "questionEN": "Do you have a headache?", + "questionAR": "هل تعاني من صداع في الرأس؟", + "ans": 2 + }, + { + "id": 12, + "questionEN": "Do you have muscle pain?", + "questionAR": "هل تعانين من آلام عضلية؟", + "ans": 2 + }, + { + "id": 13, + "questionEN": "Do you have joint pain?", + "questionAR": "هل تعانين من آلام المفاصل؟", + "ans": 2 + }, + { + "id": 14, + "questionEN": "Do you have diarrhea?", + "questionAR": "هل لديك اسهال؟", + "ans": 2 + } +] \ No newline at end of file diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index df846dd6..d070415c 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -269226e53e3ba1b1460fd3df51f89f77 \ No newline at end of file +e52eba3667a38bec777870899c15ae7d \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index ea6d2244..2ce396c4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -277,6 +277,11 @@ PODS: - Flutter - file_picker_web (0.0.1): - Flutter + - Firebase/Analytics (6.33.0): + - Firebase/Core + - Firebase/Core (6.33.0): + - Firebase/CoreOnly + - FirebaseAnalytics (= 6.8.3) - Firebase/CoreOnly (6.33.0): - FirebaseCore (= 6.10.3) - Firebase/Firestore (6.33.0): @@ -285,6 +290,13 @@ PODS: - Firebase/Messaging (6.33.0): - Firebase/CoreOnly - FirebaseMessaging (~> 4.7.0) + - firebase_analytics (6.3.0): + - Firebase/Analytics (~> 6.33.0) + - Firebase/CoreOnly (~> 6.33.0) + - firebase_core + - Flutter + - firebase_analytics_web (0.1.0): + - Flutter - firebase_core (0.5.3): - Firebase/CoreOnly (~> 6.33.0) - Flutter @@ -295,6 +307,15 @@ PODS: - Firebase/Messaging (~> 6.33.0) - firebase_core - Flutter + - FirebaseAnalytics (6.8.3): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleAppMeasurement (= 6.8.3) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/MethodSwizzler (~> 6.7) + - GoogleUtilities/Network (~> 6.7) + - "GoogleUtilities/NSData+zlib (~> 6.7)" + - nanopb (~> 1.30906.0) - FirebaseCore (6.10.3): - FirebaseCoreDiagnostics (~> 1.6) - GoogleUtilities/Environment (~> 6.7) @@ -352,11 +373,17 @@ PODS: - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) - - geolocator (6.1.9): + - geolocator (6.2.0): - Flutter - google_maps_flutter (0.0.1): - Flutter - GoogleMaps (< 3.10) + - GoogleAppMeasurement (6.8.3): + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/MethodSwizzler (~> 6.7) + - GoogleUtilities/Network (~> 6.7) + - "GoogleUtilities/NSData+zlib (~> 6.7)" + - nanopb (~> 1.30906.0) - GoogleDataTransport (7.5.1): - nanopb (~> 1.30906.0) - GoogleMaps (3.9.0): @@ -372,6 +399,8 @@ PODS: - PromisesObjC (~> 1.2) - GoogleUtilities/Logger (6.7.2): - GoogleUtilities/Environment + - GoogleUtilities/MethodSwizzler (6.7.2): + - GoogleUtilities/Logger - GoogleUtilities/Network (6.7.2): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" @@ -435,6 +464,8 @@ PODS: - nanopb/encode (1.30906.0) - native_device_orientation (0.0.1): - Flutter + - nfc_in_flutter (1.0.0): + - Flutter - NVActivityIndicatorView (5.1.1): - NVActivityIndicatorView/Base (= 5.1.1) - NVActivityIndicatorView/Base (5.1.1) @@ -446,7 +477,7 @@ PODS: - Flutter - path_provider_windows (0.0.1): - Flutter - - "permission_handler (5.0.1+1)": + - "permission_handler (5.1.0+2)": - Flutter - PromisesObjC (1.2.11) - Protobuf (3.13.0) @@ -477,9 +508,9 @@ PODS: - SwiftyGif (5.4.0) - TOCropViewController (2.5.5) - Try (2.1.1) - - "twilio_programmable_video (0.5.0+4)": + - "twilio_programmable_video (0.6.4+1)": - Flutter - - TwilioVideo (~> 3.4) + - TwilioVideo (~> 3.7) - TwilioVideo (3.8.0) - url_launcher (0.0.1): - Flutter @@ -518,6 +549,8 @@ DEPENDENCIES: - device_info (from `.symlinks/plugins/device_info/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) - file_picker_web (from `.symlinks/plugins/file_picker_web/ios`) + - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) + - firebase_analytics_web (from `.symlinks/plugins/firebase_analytics_web/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) @@ -542,6 +575,7 @@ DEPENDENCIES: - map_launcher (from `.symlinks/plugins/map_launcher/ios`) - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`) + - nfc_in_flutter (from `.symlinks/plugins/nfc_in_flutter/ios`) - NVActivityIndicatorView - path_provider (from `.symlinks/plugins/path_provider/ios`) - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) @@ -578,6 +612,7 @@ SPEC REPOS: - DKImagePickerController - DKPhotoGallery - Firebase + - FirebaseAnalytics - FirebaseCore - FirebaseCoreDiagnostics - FirebaseFirestore @@ -585,6 +620,7 @@ SPEC REPOS: - FirebaseInstanceID - FirebaseMessaging - FMDB + - GoogleAppMeasurement - GoogleDataTransport - GoogleMaps - GoogleUtilities @@ -626,6 +662,10 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/file_picker/ios" file_picker_web: :path: ".symlinks/plugins/file_picker_web/ios" + firebase_analytics: + :path: ".symlinks/plugins/firebase_analytics/ios" + firebase_analytics_web: + :path: ".symlinks/plugins/firebase_analytics_web/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" firebase_core_web: @@ -674,6 +714,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/maps_launcher/ios" native_device_orientation: :path: ".symlinks/plugins/native_device_orientation/ios" + nfc_in_flutter: + :path: ".symlinks/plugins/nfc_in_flutter/ios" path_provider: :path: ".symlinks/plugins/path_provider/ios" path_provider_linux: @@ -746,9 +788,12 @@ SPEC CHECKSUMS: file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1 file_picker_web: 37b10786e88885124fac99dc899866e78a132ef3 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 + firebase_analytics: 36a619088c46224900829f14f4daa71585693a6f + firebase_analytics_web: 7d539061ea4af07563a0e21044af89cab70efec0 firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 + FirebaseAnalytics: 5dd088bd2e67bb9d13dbf792d1164ceaf3052193 FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 FirebaseFirestore: adff4877869ca91a11250cc0989a6cd56bad163f @@ -764,8 +809,9 @@ SPEC CHECKSUMS: flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 + geolocator: f5e3de65e241caba7ce3e8a618803387bda73384 google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 + GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 @@ -785,12 +831,13 @@ SPEC CHECKSUMS: MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc native_device_orientation: e24d00be281de72996640885d80e706142707660 + nfc_in_flutter: c656fbfb1ec5b9d021da87b0c87629d62fd5264d NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 @@ -807,7 +854,7 @@ SPEC CHECKSUMS: SwiftyGif: 5d4af95df24caf1c570dbbcb32a3b8a0763bc6d7 TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f + twilio_programmable_video: ce33772ea8275b413c0ab5c5aa2e35f9da2d4066 TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 @@ -822,6 +869,6 @@ SPEC CHECKSUMS: webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 wifi: d7d77c94109e36c4175d845f0a5964eadba71060 -PODFILE CHECKSUM: ac5efa1ac3c9555d0008dc18004313c84746da62 +PODFILE CHECKSUM: 900f7dc480de5b961c031ed418407e0e40ed455c -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 366647c0..e4453fa6 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -220,6 +220,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */, + 29B24CD65FDFD6111DD04897 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -305,6 +306,23 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; + 29B24CD65FDFD6111DD04897 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5a1df0a3..875a97d3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -423,6 +423,10 @@ const Map localizedValues = { "en": "Please select treatment start day and time to be notified when it\'s time to take the medicine", "ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" }, + "pleaseSelectAllQuestionToContinue": { + "en": "Please answer all questions to continue...", + "ar": "يرجى الإجابة على جميع الأسئلة للمتابعة..." + }, "StartDay": {"en": "Start Day", "ar": "يوم البداية"}, "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, "Days": {"en": "Days ", "ar": "أيام"}, diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart new file mode 100644 index 00000000..b6ccff1d --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -0,0 +1,165 @@ +import 'dart:collection'; +import 'dart:convert'; + +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; +import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'covid-payment-details.dart'; +class CovidDirveThruQuestions extends StatefulWidget{ + final String projectId; + final List proceduresList; + CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList}); + + @override + CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); + +} +class CovidDirveThruQuestionsState extends State{ + List qa; + + @override + void initState() { + super.initState(); + qa = getQuestionsFromJson(); + } + + TranslationBase localize; + @override + Widget build(BuildContext context) { + localize = TranslationBase.of(context); + var isArabic = localize.isArabic(); + return AppScaffold( + appBarTitle: TranslationBase.of(context).covidTest, + isShowAppBar: true, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(20), + child: Text(localize.covidSelectProcedure, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)), + ), + Expanded( + child: ListView.separated( + padding: EdgeInsets.symmetric(horizontal: 20), + itemCount: qa.length, + itemBuilder: (ctx, idx){ + var obj = qa[idx]; + var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)), + Row( + children: [ + Radio( + value: 1, + groupValue: obj["ans"], + onChanged: (newValue){ + setState(() { + obj["ans"] = newValue; + }); + } + ), + Text(localize.yes), + ], + ), + + Row( + children: [ + Radio( + value: 0, + groupValue: obj["ans"], + onChanged: (newValue){ + setState(() { + obj["ans"] = newValue; + }); + } + ), + Text(localize.no), + ], + ) + ], + ), + ); + }, + separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), + ) + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), + child: FractionallySizedBox( + widthFactor: 1, + child: MaterialButton( + height: 50, + color: Theme.of(context).appBarTheme.color, + disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), + child: Text(localize.next, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), + onPressed: next + ), + ), + ), + ], + ) + ); + } + + next() async{ + bool all = true; + qa.forEach((element) { + all = all && (element["ans"] == 1 || element["ans"] == 0); + }); + if(all) + getPaymentInfo(context,widget.projectId); + else + AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue); + } + + List getQuestionsFromJson(){ + var questionsJson = + """ + [{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]"""; + var map = json.decode(questionsJson) as List; + return map; + } + + getPaymentInfo(BuildContext context, String projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + CovidPaymentInfoResponse covidPaymentInfoResponse = + new CovidPaymentInfoResponse(); + GifLoaderDialogUtils.showMyDialog(context); + service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + // setState(() { + // covidPaymentInfoResponse = + // CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + // }); + Navigator.push( + context, + FadePage( + page: CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + proceduresList: widget.proceduresList, + ))); + } else {} + }).catchError((err) { + print(err); + }); + } + +} \ No newline at end of file diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index eccf48fc..3846c03b 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -16,6 +16,8 @@ import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'covid-dirvethru-questions.dart'; + class CovidDrivethruLocation extends StatefulWidget { @override _CovidDrivethruLocationState createState() => _CovidDrivethruLocationState(); @@ -267,7 +269,9 @@ class _CovidDrivethruLocationState extends State { next() { if (isLocationSelected) { - getPaymentInfo(context, projectID); + Navigator.push( + context, + FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList,))); } else { Utils.showErrorToast( "Please select address from the dropdown menu to continue"); diff --git a/lib/uitl/app_toast.dart b/lib/uitl/app_toast.dart index cfac3b97..f997b6b8 100644 --- a/lib/uitl/app_toast.dart +++ b/lib/uitl/app_toast.dart @@ -92,7 +92,7 @@ class AppToast { double fontSize = 16, ToastGravity toastGravity = ToastGravity.TOP, Color textColor = Colors.white, - int radius, + int radius = 15, int elevation, int imageSize = 32, }) { @@ -107,7 +107,9 @@ class AppToast { icon: ICON.CLOSE, radius: radius, elevation: elevation, - imageSize: imageSize); + imageSize: imageSize + ); + } /// cancel toast diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f0d2b243..6ebba17b 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1192,6 +1192,7 @@ class TranslationBase { String get iAcceptTerms => localizedValues["i-accept-terms"][locale.languageCode]; String get upComingPayOption => localizedValues["upcoming-pay-options"][locale.languageCode]; String get pleaseAcceptTerms => localizedValues["please-accept-terms"][locale.languageCode]; + String get pleaseSelectAllQuestionToContinue => localizedValues["pleaseSelectAllQuestionToContinue"][locale.languageCode]; String get type => localizedValues["type"][locale.languageCode]; String get eReferralInfo => localizedValues["info-ereferral"][locale.languageCode]; String get erConsultation => localizedValues["er-consultation"][locale.languageCode]; @@ -1233,3 +1234,7 @@ class TranslationBaseDelegate extends LocalizationsDelegate { @override bool shouldReload(TranslationBaseDelegate old) => false; } + +extension xTranslationBase on TranslationBase{ + isArabic() => locale.languageCode == "ar"; +} \ No newline at end of file From e96157c74a607bf62f4bde5462e0c66efb500f5d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 25 Aug 2021 11:32:28 +0300 Subject: [PATCH 08/10] Covid certificate passport CR implemented --- lib/config/config.dart | 10 +- lib/config/localized_values.dart | 4 + lib/core/service/medical/labs_service.dart | 36 +++++- .../medical/labs/passport_update_page.dart | 122 ++++++++++++++++++ lib/uitl/translations_delegate_base.dart | 4 + .../medical/LabResult/LabResultWidget.dart | 36 +++++- lib/widgets/dialogs/confirm_dialog.dart | 1 + 7 files changed, 204 insertions(+), 9 deletions(-) create mode 100644 lib/pages/medical/labs/passport_update_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 3dc8f3e6..40cd68bb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -79,6 +79,12 @@ const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const SEND_COVID_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/GenerateCOVIDReport'; +const COVID_PASSPORT_UPDATE = + 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; +const GET_PATIENT_PASSPORT_NUMBER = + 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 50eae821..ffdbadcf 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1346,4 +1346,8 @@ const Map localizedValues = { "no-thankyou": {"en": "No Thanks", "ar": "لا شكرا"}, "visit-clinic": {"en": "Schedule appointment with the doctor", "ar": "ارغب في حجز موعد مجدول مع الطبيب"}, "generate-covid-certificate": {"en": "Generate Covid-19 Certificate", "ar": "إنشاء شهادة كورونا"}, + "is-report-outside-ksa": {"en": "Is the certificate needed for outside KSA?", "ar": "هل الشهادة مطلوبة من خارج المملكة؟"}, + "passport-number": {"en": "Passport Number", "ar": "رقم جواز السفر"}, + "enter-passport-number": {"en": "Please confirm or update your passport number:", "ar": "الرجاء تأكيد أو تحديث رقم جواز السفر الخاص بك:"}, + "valid-passport-number": {"en": "Please enter valid passport number", "ar": "الرجاء إدخال رقم جواز سفر صالح"}, }; diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 1d88782d..6571c76f 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -70,7 +70,7 @@ class LabsService extends BaseService { }, body: body); } - Future generateCovidLabReport(LabResult covidLabResult) async { + Future generateCovidLabReport(LabResult covidLabResult, String isOutsideKSA) async { hasError = false; Map body = Map(); @@ -80,7 +80,7 @@ class LabsService extends BaseService { body['LineItemNo'] = covidLabResult.resultValueBasedLineItemNo; body['CertificateFormat'] = 5; body['GeneratedBy'] = 102; - body['ShowPassportNumber'] = "no"; + body['ShowPassportNumber'] = isOutsideKSA; body['isDentalAllowedBackend'] = false; body['SetupID'] = covidLabResult.setupID; body['ProjectID'] = covidLabResult.projectID; @@ -96,6 +96,38 @@ class LabsService extends BaseService { return Future.value(localRes); } + Future updateCovidPassportNumber(String passportNumber) async { + hasError = false; + Map body = Map(); + + body['PassportNo'] = passportNumber; + + dynamic localRes; + + await baseAppClient.post(COVID_PASSPORT_UPDATE, onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return Future.value(localRes); + } + + Future getCovidPassportNumber() async { + hasError = false; + Map body = Map(); + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_PASSPORT_NUMBER, onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + return Future.value(localRes); + } + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { hasError = false; Map body = Map(); diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart new file mode 100644 index 00000000..0931431c --- /dev/null +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -0,0 +1,122 @@ +import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class PassportUpdatePage extends StatefulWidget { + @override + _PassportUpdatePageState createState() => _PassportUpdatePageState(); +} + +class _PassportUpdatePageState extends State { + TextEditingController passportNumber = new TextEditingController(); + bool _isButtonDisabled; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) => getPassportNumber()); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).passportNumber, + isShowAppBar: true, + isBottomBar: true, + body: Container( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(45.0), + child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)), + ), + Container( + margin: EdgeInsets.only(top: 5.0, bottom: 5.0), + child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill), + ), + Container( + margin: EdgeInsets.only(left: 50.0, right: 50.0, top: 25.0), + child: TextFields( + keyboardType: TextInputType.text, + fontWeight: FontWeight.normal, + controller: passportNumber, + onChanged: (value) => {_onPassportTextChanged(value)}, + padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10), + hintText: TranslationBase.of(context).passportNumber, + )) + ], + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.only(top: 10.0, left: 30.0, right: 30.0, bottom: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.red[300], + onPressed: () { + if (_isButtonDisabled == false) + updatePassportNumber(); + else + AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber); + }, + child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ); + } + + _onPassportTextChanged(content) { + if (content.length >= 1) { + setState(() { + _isButtonDisabled = false; + }); + } else { + setState(() { + _isButtonDisabled = true; + }); + } + } + + void updatePassportNumber() { + LabsService service = new LabsService(); + GifLoaderDialogUtils.showMyDialog(context); + + service.updateCovidPassportNumber(passportNumber.text).then((res) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pop(true); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + void getPassportNumber() { + LabsService service = new LabsService(); + GifLoaderDialogUtils.showMyDialog(context); + + service.getCovidPassportNumber().then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']); + passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b32f1c8b..45472292 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1218,6 +1218,10 @@ class TranslationBase { String get noThankyou => localizedValues["no-thankyou"][locale.languageCode]; String get visitClinic => localizedValues["visit-clinic"][locale.languageCode]; String get generateCovidCertificate => localizedValues["generate-covid-certificate"][locale.languageCode]; + String get isReportOutsideKsa => localizedValues["is-report-outside-ksa"][locale.languageCode]; + String get passportNumber => localizedValues["passport-number"][locale.languageCode]; + String get enterPassportNumber => localizedValues["enter-passport-number"][locale.languageCode]; + String get validPassportNumber => localizedValues["valid-passport-number"][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 8b277cc2..eabe583e 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -79,7 +81,7 @@ class LabResultWidget extends StatelessWidget { disabledTextColor: Colors.white, disabledColor: Colors.red[300], onPressed: () { - showConfirmMessage(context, projectViewModel.user.emailAddress); + showKSADialog(context); }, child: Text(TranslationBase.of(context).generateCovidCertificate, style: TextStyle(fontSize: 18.0)), ), @@ -91,11 +93,11 @@ class LabResultWidget extends StatelessWidget { ); } - generateCovidCertificate(BuildContext context) { + generateCovidCertificate(BuildContext context, String isOutsideKSA) { LabsService service = new LabsService(); GifLoaderDialogUtils.showMyDialog(context); - service.generateCovidLabReport(covidLabResult).then((res) { + service.generateCovidLabReport(covidLabResult, isOutsideKSA).then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully); }).catchError((err) { @@ -104,13 +106,37 @@ class LabResultWidget extends StatelessWidget { }); } - void showConfirmMessage(BuildContext context, String email) { + openPassportUpdatePage(BuildContext context) { + Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { + print(value); + if(value != null && value == true) { + showConfirmMessage(context, projectViewModel.user.emailAddress, "yes"); + } + }); + } + + void showKSADialog(BuildContext context) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).isReportOutsideKsa, + okText: TranslationBase.of(context).yes, + cancelText: TranslationBase.of(context).no, + okFunction: () => { + Navigator.of(context).pop(), + openPassportUpdatePage(context) + // showConfirmMessage(context, projectViewModel.user.emailAddress, "yes") + }, + cancelFunction: () => {showConfirmMessage(context, projectViewModel.user.emailAddress, "no")}); + dialog.showAlertDialog(context); + } + + void showConfirmMessage(BuildContext context, String email, String isOutsideKSA) { showDialog( context: context, child: ConfirmSendEmailDialog( email: email, onTapSendEmail: () { - generateCovidCertificate(context); + generateCovidCertificate(context, isOutsideKSA); }, ), ); diff --git a/lib/widgets/dialogs/confirm_dialog.dart b/lib/widgets/dialogs/confirm_dialog.dart index 02b208ad..76391322 100644 --- a/lib/widgets/dialogs/confirm_dialog.dart +++ b/lib/widgets/dialogs/confirm_dialog.dart @@ -28,6 +28,7 @@ class ConfirmDialog { child: Texts(this.cancelText), onPressed: () { Navigator.of(context).pop(); + cancelFunction(); }); Widget continueButton = FlatButton(child: Texts(okText), onPressed: okFunction); From 0d1d68273b593cec0a4b61cdc2bc260bf0216ee0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 25 Aug 2021 16:21:21 +0300 Subject: [PATCH 09/10] Covid passport CR implemented in Covid test flow --- .../covid-dirvethru-questions.dart | 163 +++++++++--------- lib/pages/login/login.dart | 8 +- .../medical/labs/passport_update_page.dart | 3 + 3 files changed, 90 insertions(+), 84 deletions(-) diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index b6ccff1d..ed048b9f 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -1,8 +1,8 @@ -import 'dart:collection'; import 'dart:convert'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -11,19 +11,20 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'covid-payment-details.dart'; -class CovidDirveThruQuestions extends StatefulWidget{ + +class CovidDirveThruQuestions extends StatefulWidget { final String projectId; final List proceduresList; + CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList}); @override - CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); - + CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); } -class CovidDirveThruQuestionsState extends State{ + +class CovidDirveThruQuestionsState extends State { List qa; @override @@ -33,10 +34,11 @@ class CovidDirveThruQuestionsState extends State{ } TranslationBase localize; + @override Widget build(BuildContext context) { localize = TranslationBase.of(context); - var isArabic = localize.isArabic(); + var isArabic = localize.isArabic(); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, @@ -49,54 +51,50 @@ class CovidDirveThruQuestionsState extends State{ ), Expanded( child: ListView.separated( - padding: EdgeInsets.symmetric(horizontal: 20), - itemCount: qa.length, - itemBuilder: (ctx, idx){ - var obj = qa[idx]; - var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; - - return Padding( - padding: const EdgeInsets.symmetric(vertical: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)), - Row( - children: [ - Radio( - value: 1, - groupValue: obj["ans"], - onChanged: (newValue){ - setState(() { - obj["ans"] = newValue; - }); - } - ), - Text(localize.yes), - ], - ), + padding: EdgeInsets.symmetric(horizontal: 20), + itemCount: qa.length, + itemBuilder: (ctx, idx) { + var obj = qa[idx]; + var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; - Row( - children: [ - Radio( - value: 0, - groupValue: obj["ans"], - onChanged: (newValue){ - setState(() { - obj["ans"] = newValue; - }); - } - ), - Text(localize.no), - ], - ) - ], - ), - ); - }, - separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), - ) - ), + return Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)), + Row( + children: [ + Radio( + value: 1, + groupValue: obj["ans"], + onChanged: (newValue) { + setState(() { + obj["ans"] = newValue; + }); + }), + Text(localize.yes), + ], + ), + Row( + children: [ + Radio( + value: 0, + groupValue: obj["ans"], + onChanged: (newValue) { + setState(() { + obj["ans"] = newValue; + }); + }), + Text(localize.no), + ], + ) + ], + ), + ); + }, + separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), + )), Padding( padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), child: FractionallySizedBox( @@ -105,31 +103,43 @@ class CovidDirveThruQuestionsState extends State{ height: 50, color: Theme.of(context).appBarTheme.color, disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), - child: Text(localize.next, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), - onPressed: next - ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + child: Text( + localize.next, + style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1), + ), + onPressed: next), ), ), ], - ) - ); + )); } - next() async{ + next() async { bool all = true; qa.forEach((element) { all = all && (element["ans"] == 1 || element["ans"] == 0); }); - if(all) - getPaymentInfo(context,widget.projectId); + if (all) if (qa[0]["ans"] == 1) { + openPassportUpdatePage(); + } else { + getPaymentInfo(context, widget.projectId); + } else AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue); } - List getQuestionsFromJson(){ - var questionsJson = - """ + openPassportUpdatePage() { + Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { + print(value); + if(value != null && value == true) { + getPaymentInfo(context, widget.projectId); + } + }); + } + + List getQuestionsFromJson() { + var questionsJson = """ [{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]"""; var map = json.decode(questionsJson) as List; return map; @@ -137,29 +147,22 @@ class CovidDirveThruQuestionsState extends State{ getPaymentInfo(BuildContext context, String projectID) { CovidDriveThruService service = new CovidDriveThruService(); - CovidPaymentInfoResponse covidPaymentInfoResponse = - new CovidPaymentInfoResponse(); + CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID) - .then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - // setState(() { - // covidPaymentInfoResponse = - // CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); - // }); Navigator.push( context, FadePage( page: CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - proceduresList: widget.proceduresList, - ))); + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + proceduresList: widget.proceduresList, + ))); } else {} }).catchError((err) { print(err); }); } - -} \ No newline at end of file +} diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c8c236db..245167e6 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -279,10 +279,10 @@ class _Login extends State { // result['CRSVerificationStatus']; projectViewModel.user = authenticatedUserObject.user; - await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) - await pharmacyModuleViewModel.createUser(); - }); + // await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + // if (pharmacyModuleViewModel.error.isNotEmpty) + // await pharmacyModuleViewModel.createUser(); + // }); appointmentRateViewModel .getIsLastAppointmentRatedList() diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index 0931431c..1e81b2e5 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -114,6 +114,9 @@ class _PassportUpdatePageState extends State { GifLoaderDialogUtils.hideDialog(context); print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']); passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; + if(res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { + _isButtonDisabled = false; + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); From 8b3a0b3ada842e556ba413d644cf10166a9c5635 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 29 Aug 2021 07:14:25 +0000 Subject: [PATCH 10/10] Revert "Merge branch 'foote_in_all_pages' into 'development'" This reverts merge request !369 --- .../NewCMC/new_cmc_step_one_page.dart | 1 - .../NewCMC/new_cmc_step_three_page.dart | 1 - .../NewCMC/new_cmc_step_tow_page.dart | 1 - .../orders_log_details_page.dart | 1 - .../new_e_referral_step_one_page.dart | 1 - .../new_e_referral_step_three_page.dart | 1 - .../new_e_referral_step_two_page.dart | 1 - .../E-Referral/e_referral_page.dart | 1 - .../E-Referral/search_for_referrals_page.dart | 1 - .../new_Home_health_care_step_one_page.dart | 1 - .../new_Home_health_care_step_three_page.dart | 1 - .../new_Home_health_care_step_tow_page.dart | 1 - .../home_health_care_index_page.dart | 69 +++++++ .../orders_log_details_page.dart | 1 - .../all_habib_medical_service_page.dart | 2 +- .../h2o/h2o_index_page.dart | 1 - .../AlHabibMedicalService/h2o/h2o_page.dart | 1 - .../AlHabibMedicalService/h2o/month_page.dart | 2 - .../AlHabibMedicalService/h2o/today_page.dart | 1 - .../AlHabibMedicalService/h2o/week_page.dart | 1 - lib/pages/BookAppointment/BookingOptions.dart | 2 - lib/pages/BookAppointment/DoctorProfile.dart | 1 - .../ContactUs/LiveChat/livechat_page.dart | 1 - lib/pages/ContactUs/findus/findus_page.dart | 1 - lib/pages/DrawerPages/family/my-family.dart | 7 +- lib/pages/ErService/AmbulanceReq.dart | 1 - .../MyAppointments/AppointmentDetails.dart | 1 - lib/pages/ToDoList/ToDo.dart | 2 - lib/pages/feedback/feedback_home_page.dart | 1 - lib/pages/landing/home_page.dart | 1 - lib/pages/landing/landing_page.dart | 180 +++++++++--------- lib/pages/landing/landing_page_pharmcy.dart | 29 +++ lib/pages/livecare/livecare_home.dart | 1 - lib/pages/login/confirm-login.dart | 1 - lib/pages/login/forgot-password.dart | 1 - lib/pages/login/login-type.dart | 1 - lib/pages/login/login.dart | 1 - lib/pages/login/register-info.dart | 1 - lib/pages/login/register.dart | 1 - lib/pages/login/welcome.dart | 1 - .../ask_doctor/ask_doctor_home_page.dart | 1 - lib/pages/medical/eye/EyeHomePage.dart | 1 - lib/pages/medical/medical_profile_page.dart | 9 +- .../my_trackers/Weight/WeightHomePage.dart | 44 ++--- .../blood_pressure/BloodPressureHomePage.dart | 30 ++- .../blood_suger/blood_sugar_home_page.dart | 30 ++- .../prescriptions_home_page.dart | 1 - .../medical/reports/report_home_page.dart | 1 - .../smart_watch_health_data/stepsTracker.dart | 1 - .../screens/pharmacy_module_page.dart | 1 - lib/pages/pharmacy_categorise.dart | 1 - lib/widgets/others/app_scaffold_widget.dart | 78 ++------ 52 files changed, 256 insertions(+), 267 deletions(-) create mode 100644 lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index fb41e39a..c07b8345 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -40,7 +40,6 @@ class _NewCMCStepOnePageState extends State { return AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, baseViewModel: widget.model, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index a5dcf998..75699a5c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -65,7 +65,6 @@ class _NewCMCStepThreePageState extends State { return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 3a0f35ff..3d969d9e 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -71,7 +71,6 @@ class _NewCMCStepTowPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, - isShowBottomNavBar: false, body: Stack( children: [ PlacePicker( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index c6a09c3c..ec686e70 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -51,7 +51,6 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 2bf6427e..5a3271f2 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -93,7 +93,6 @@ class _NewEReferralStepOnePageState extends State { onModelReady: (model) => model.getRelationTypes(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index c377148f..a823c154 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -52,7 +52,6 @@ class _NewEReferralStepThreePageState extends State { return BaseView( builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 2b27cc7a..5f85fe12 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -60,7 +60,6 @@ class _NewEReferralStepTowPageState extends State { onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index ddb374fb..9007229a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -38,7 +38,6 @@ class _EReferralPageState extends State return BaseView( builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).ereferral, description: TranslationBase.of(context).eReferralInfo, imagesInfo: [ diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 0d77ff24..0b75705d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -47,7 +47,6 @@ class _SearchForReferralsPageState extends State { onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 5503895a..86ee791b 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -52,7 +52,6 @@ class _NewHomeHealthCareStepOnePageState return AppScaffold( isShowAppBar: false, baseViewModel: widget.model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index 210345cb..5e9bd04d 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -71,7 +71,6 @@ class _NewHomeHealthCareStepThreePageState return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 4dfffa82..e9ddd2d1 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -74,7 +74,6 @@ class _NewHomeHealthCareStepTowPageState ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, - isShowBottomNavBar: false, body: Stack( children: [ PlacePicker( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart new file mode 100644 index 00000000..fa0799f9 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'home_health_care_page.dart'; + +class HomeHealthCareIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).homeHealthCare, + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + TranslationBase.of(context).homeHealthCareText, + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ), + label: TranslationBase.of(context).loginRegister, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 79d037f5..f0ca5fe4 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -51,7 +51,6 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 43eeedfa..d6a60e3d 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -169,7 +169,7 @@ class _AllHabibMedicalServiceState extends State { Navigator.push( context, FadePage( - page: MedicalProfilePage(isFromAllServicePage: true), + page: MedicalProfilePage(), ), ); }, diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index 09dbc4e3..e6e05ee6 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -13,7 +13,6 @@ class H2OPageIndexPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - //isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).serviceInformation, body: SingleChildScrollView( padding: EdgeInsets.all(12), diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 49e5c8db..b847190f 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -48,7 +48,6 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { onModelReady: (model) => model.getUserDetail(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).waterTracker, showHomeAppBarIcon: false, baseViewModel: model, diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index e65bef82..8867fb77 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -19,8 +19,6 @@ class MonthPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForMonthData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, - appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index e8e15a83..03d11f50 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -22,7 +22,6 @@ class TodayPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: SingleChildScrollView( diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index 0c9691c4..6f4423b2 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -19,7 +19,6 @@ class WeekPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForWeekData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index 91d90da6..83af454f 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -32,8 +32,6 @@ class _BookingOptionsState extends State { return AppScaffold( isShowAppBar: widget.isAppbar, isShowDecPage: false, - isShowBottomNavBar: false, - appBarTitle: TranslationBase.of(context).bookAppo, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6929755b..9c52adef 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -68,7 +68,6 @@ class _DoctorProfileState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, - isShowBottomNavBar: false, isShowDecPage: false, bottomSheet: showFooterButton ? Container( diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index f2485cb6..a747db3d 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -41,7 +41,6 @@ class _LiveChatPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, imagesInfo: imagesInfo, title: TranslationBase.of(context).liveChat, description: TranslationBase.of(context).infoChat, diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index a01e2fd5..80648292 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -39,7 +39,6 @@ class _FindUsPageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: 'Locations', baseViewModel: model, body: Scaffold( diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 0dfbd429..7493dfc1 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -38,10 +38,7 @@ import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; - - final bool isFromAllServicePage; - - MyFamily({this.isAppbarVisible = true, this.isFromAllServicePage = false}); + MyFamily({this.isAppbarVisible = true}); @override _MyFamily createState() => _MyFamily(); } @@ -95,8 +92,6 @@ class _MyFamily extends State with TickerProviderStateMixin { isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, description: TranslationBase.of(context).familyInfo, - isShowBottomNavBar: widget.isFromAllServicePage, - body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 72e775e3..1d4e78ee 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -51,7 +51,6 @@ class _AmbulanceReqState extends State onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).transportationService, description: TranslationBase.of(context).infoAmbulance, imagesInfo: imagesInfo, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 1de71291..877192e6 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -57,7 +57,6 @@ class _AppointmentDetailsState extends State return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, - isShowBottomNavBar: false, bottomSheet: AppointmentDetails.showFooterButton ? Container( width: MediaQuery.of(context).size.width, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 6ef794c8..febbdf0f 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -81,8 +81,6 @@ class _ToDoState extends State { isShowAppBar: widget.isShowAppBar, isShowDecPage: true, description: TranslationBase.of(context).infoTodo, - isShowBottomNavBar: false, - body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index f19eeedf..15f348f9 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -42,7 +42,6 @@ class _FeedbackHomePageState extends State isShowAppBar: true, isBottomBar: false, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).feedbackTitle, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b639af78..b64d2330 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -50,7 +50,6 @@ class _HomePageState extends State { builder: (_, model, wi) => AppScaffold( isShowDecPage: false, isHelp: true, - isShowBottomNavBar: false, body: Container( width: double.infinity, child: SingleChildScrollView( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 21863766..b8607a89 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -32,7 +32,6 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:firebase_analytics/observer.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -50,11 +49,8 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class LandingPage extends StatefulWidget { static LandingPage shared; - int currentTab = 0; _LandingPageState state; - - LandingPage({currentTabLocal}) { - currentTab = currentTabLocal ?? 0; + LandingPage() { LandingPage.shared = this; } @@ -73,6 +69,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); + int currentTab = 0; PageController pageController; ProjectViewModel projectViewModel; ToDoCountProviderModel model; @@ -105,7 +102,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(int tab) { setState(() { - if (widget.currentTab > 0 && tab == 2) + if (currentTab > 0 && tab == 2) pageController.jumpToPage(0); else if (tab != 0) { if (tab == 4 && model.count == 0) { @@ -119,7 +116,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(tab); } - widget.currentTab = tab; + currentTab = tab; }); } @@ -178,8 +175,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { AppGlobal.context = context; _requestIOSPermissions(); - pageController = - PageController(keepPage: true, initialPage: widget.currentTab); + pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); locationUtils = @@ -488,84 +484,94 @@ class _LandingPageState extends State with WidgetsBindingObserver { projectViewModel = Provider.of(context); model = Provider.of(context); - return AppScaffold( - isShowAppBar: true, - showHomeAppBarIcon: false, - appBarTitle: getText(widget.currentTab).toUpperCase(), - leading: Builder( - builder: (BuildContext context) { - return new Stack( - children: [ - widget.currentTab == 0 - ? IconButton( - icon: Icon(Icons.menu), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () => Scaffold.of(context).openDrawer(), - ) - : IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - setState(() { - widget.currentTab = 0; - }); - - pageController.jumpToPage(0); - }, - ), - notificationCount != '' - ? new Positioned( - right: projectViewModel.isArabic ? 35 : 0, - top: 5, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - notificationCount, - style: new TextStyle( - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + return Scaffold( + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + 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'), + // bold: true, + // color: Colors.white, + ), + leading: Builder( + builder: (BuildContext context) { + return new Stack( + children: [ + currentTab == 0 + ? IconButton( + icon: Icon(Icons.menu), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () => Scaffold.of(context).openDrawer(), + ) + : IconButton( + icon: Icon(Icons.arrow_back), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () { + setState(() { + currentTab = 0; + }); + + pageController.jumpToPage(0); + }, + ), + notificationCount != '' + ? new Positioned( + right: projectViewModel.isArabic ? 35 : 0, + top: 5, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectViewModel.isArabic ? 8 : 9, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), - ), - ) - : SizedBox() - ], - ); - }, + ) + : SizedBox() + ], + ); + }, + ), + actions: [ + IconButton( + //iconSize: 70, + icon: Icon( + projectViewModel.isLogin ? Icons.settings : Icons.login, + color: Theme.of(context).textTheme.headline1.color, + ), + onPressed: () { + if (projectViewModel.isLogin) + Navigator.of(context).pushNamed( + SETTINGS, + ); + else + login(); + }, //do something, + ) + ], + centerTitle: true, ), - isShowDrawer: true, - appBarIcons: [ - IconButton( - //iconSize: 70, - icon: Icon( - projectViewModel.isLogin ? Icons.settings : Icons.login, - color: Theme.of(context).textTheme.headline1.color, - ), - onPressed: () { - if (projectViewModel.isLogin) - Navigator.of(context).pushNamed( - SETTINGS, - ); - else - login(); - }, //do something, - ) - ], - // drawer: SafeArea(child: AppDrawer()), - // extendBody: true, - isShowDecPage: false, - changeTab: changeCurrentTab, - isFromLandingPage: true, - currentTab: widget.currentTab, + drawer: SafeArea(child: AppDrawer()), + extendBody: true, body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, @@ -581,9 +587,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { ToDo(isShowAppBar: false), ], // Please do not remove the BookingOptions from this array ), + bottomNavigationBar: BottomNavBar( + changeIndex: changeCurrentTab, + index: currentTab, + ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: - (projectViewModel.havePrivilege(34) && widget.currentTab == 0) + (projectViewModel.havePrivilege(34) && currentTab == 0) ? FloatingButton( elevation: true, onTap: () { diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index e087a87e..04c9bb54 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -110,6 +110,35 @@ class _LandingPagePharmacyState extends State { centerTitle: true, ) : null, + // : AppBar( + // backgroundColor: Color(0xff5AB145), + // elevation: 0, + // textTheme: TextTheme( + // headline6: TextStyle( + // color: Colors.white, fontWeight: FontWeight.bold), + // ), + // title: Text(getText(currentTab).toUpperCase()), + // leading: Builder( + // builder: (BuildContext context) { + // return IconButton( + // icon: Icon(Icons.arrow_back), + // color: Colors.white, + // onPressed: () => Scaffold.of(context).openDrawer(), + // ); + // }, + // ), + // actions: [ + // // IconButton( + // // iconSize: 70, + // // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', + // // height: 100, width: 100, fit: BoxFit.cover), + // // onPressed: () { + // // triggerRobot(); + // // } //do something, + // // ) + // ], + // centerTitle: true, + // ), extendBody: false, body: PageView( physics: NeverScrollableScrollPhysics(), diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 403acf0c..d74dd6c8 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -51,7 +51,6 @@ class _LiveCareHomeState extends State return AppScaffold( appBarTitle: "LiveCare", isShowAppBar: true, - isShowBottomNavBar: false, imagesInfo: imagesInfo, description: TranslationBase.of(context).erConsultation, body: Container( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index d8639a6a..bcbcf6cb 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -101,7 +101,6 @@ class _ConfirmLogin extends State { appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(20), diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index fc21b0e1..d6478c92 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -31,7 +31,6 @@ class _ForgotPassword extends State { appBarTitle: TranslationBase.of(context).forgotFileNoTitle, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 18a3da8b..f8af8eac 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -21,7 +21,6 @@ class LoginType extends StatelessWidget { appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 245167e6..230e5984 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -85,7 +85,6 @@ class _Login extends State { appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index c7fc1c69..e1152032 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -74,7 +74,6 @@ class _RegisterInfo extends State { appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( padding: EdgeInsets.all(20), child: Column(children: [ diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 6fc31d4a..1591d1d5 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -49,7 +49,6 @@ class _Register extends State { appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 761d4df3..6a007e0a 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -30,7 +30,6 @@ class _WelcomeLogin extends State { appBarTitle: TranslationBase.of(context).welcome, isShowDecPage: false, isShowAppBar: true, - isShowBottomNavBar: false, body: Padding( padding: EdgeInsets.all(20), child: Column( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 770e5ca1..902225b1 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -39,7 +39,6 @@ class _AskDoctorHomPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).askDoctor, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 3af45f25..3af2279e 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -44,7 +44,6 @@ class _EyeHomePageState extends State return AppScaffold( isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).measurements, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 87a06d84..6f46388b 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -13,10 +13,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class MedicalProfilePage extends StatefulWidget { - - final bool isFromAllServicePage; - - const MedicalProfilePage({ this.isFromAllServicePage = false}) ; @override _MedicalProfilePageState createState() => _MedicalProfilePageState(); } @@ -29,7 +25,6 @@ class _MedicalProfilePageState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList( projectViewModel: projectViewModel, @@ -38,12 +33,10 @@ class _MedicalProfilePageState extends State { isLogin: projectViewModel.isLogin); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), - builder: (_, model, x) => AppScaffold( + builder: (_, model, widget) => AppScaffold( isShowDecPage: false, baseViewModel: model, isHelp: true, - isShowBottomNavBar: widget.isFromAllServicePage, - body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 5a15908b..41592110 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -42,7 +42,6 @@ class _WeightHomePageState extends State with SingleTickerProvid builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).weight, appBarIcons: [ IconButton( @@ -101,29 +100,26 @@ class _WeightHomePageState extends State with SingleTickerProvid ) ], ), - floatingActionButton: Container( - margin: EdgeInsets.only(bottom: 70), - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddWeightPage( - model: model, - ))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddWeightPage( + model: model, + ))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).primaryColor, + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index 30414245..723871cb 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -42,7 +42,6 @@ class _BloodPressureHomePageState extends State onModelReady: (model) => model.getBloodPressure(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).bloodPressure, baseViewModel: model, appBarIcons: [IconButton( @@ -95,22 +94,19 @@ class _BloodPressureHomePageState extends State ) ], ), - floatingActionButton: Container( - margin: EdgeInsets.only(bottom: 70), - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, color: Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 48f6b9d2..29989e53 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -47,7 +47,6 @@ class _BloodSugarHomePageState extends State return BaseView( onModelReady: (model) => model.getBloodSugar(), builder: (_, model, w) => AppScaffold( - isShowBottomNavBar: false, appBarIcons: [IconButton( icon: Icon(Icons.email), color: Colors.white, @@ -106,22 +105,19 @@ class _BloodSugarHomePageState extends State ) ], ), - floatingActionButton: Container( - margin: EdgeInsets.only(bottom: 70), - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, color:Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color:Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 29a6e0cb..380d6284 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -47,7 +47,6 @@ class _HomePrescriptionsPageState extends State description: TranslationBase.of(context).infoPrescriptions, infoList: TranslationBase.of(context).infoPrescriptionsPoints, imagesInfo: imagesInfo, - isShowBottomNavBar: false, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index fb6a729c..f9efb1a1 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -59,7 +59,6 @@ class _HomeReportPageState extends State onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).newMedReport, title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, diff --git a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart index d1b6607c..3fe1a4ba 100644 --- a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart @@ -44,7 +44,6 @@ class _StepsTrackerState extends State isShowAppBar: true, appBarTitle: "Steps", isShowDecPage: false, - isShowBottomNavBar: false, body: Container( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index bdb508bc..e4830583 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -80,7 +80,6 @@ class _PharmacyPageState extends State { isShowAppBar: false, isShowDecPage: false, baseViewModel: model, - isPharmacy:true, backgroundColor: Colors.white, body: Container( width: double.infinity, diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index 64b6bf6a..ff1920dc 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -35,7 +35,6 @@ class _PharmacyCategorisePageState extends State { AppScaffold( isShowDecPage: false, baseViewModel: model, - isPharmacy:true, body: Column( children: [ Expanded( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index ffd23bfd..6a20ef3f 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -12,9 +12,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.da import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -46,7 +44,6 @@ class AppScaffold extends StatelessWidget { final BaseViewModel baseViewModel; final bool isBottomBar; final Widget floatingActionButton; - final FloatingActionButtonLocation floatingActionButtonLocation; final bool isPharmacy; final bool isOfferPackages; final bool showPharmacyCart; @@ -61,19 +58,10 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final List imagesInfo; final bool isHelp; - - final int currentTab; - final bool isShowBottomNavBar; - final bool isFromLandingPage; - final bool isShowDrawer; - final Function(int tab) changeTab; - final Widget leading; - AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; - AppScaffold( {@required this.body, this.appBarTitle = '', @@ -97,14 +85,7 @@ class AppScaffold extends StatelessWidget { this.infoList, this.isHelp = false, this.showHomeAppBarIcon = true, - this.imagesInfo, - this.currentTab, - this.isShowBottomNavBar = true, - this.isFromLandingPage = false, - this.changeTab, - this.floatingActionButtonLocation, - this.leading, - this.isShowDrawer = false}); + this.imagesInfo}); AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; @@ -117,7 +98,6 @@ class AppScaffold extends StatelessWidget { return Scaffold( backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, - drawer: isShowDrawer ? SafeArea(child: AppDrawer()) : null, appBar: isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -128,21 +108,15 @@ class AppScaffold extends StatelessWidget { isOfferPackages: isOfferPackages, showOfferPackagesCart: showOfferPackagesCart, isShowDecPage: isShowDecPage, - leading: leading, ) : null, bottomSheet: bottomSheet, - bottomNavigationBar: isShowBottomNavBar && !getIsShowDecPageValue(context) && !isPharmacy - ? BottomNavBar( - changeIndex: changeCurrentTab, - index: currentTab, - ) - : null, body: SafeArea( top: true, bottom: true, child: - getIsShowDecPageValue(context) + (!Provider.of(context, listen: false).isLogin && + isShowDecPage) ? NotAutPage( title: title ?? appBarTitle, description: description, @@ -157,15 +131,9 @@ class AppScaffold extends StatelessWidget { : buildBodyWidget(context), ), floatingActionButton: floatingActionButton, - floatingActionButtonLocation: floatingActionButtonLocation, ); } - - getIsShowDecPageValue(context){ - return (!Provider.of(context, listen: false).isLogin && - isShowDecPage); - } buildAppLoaderWidget(bool isLoading) { return isLoading ? AppLoaderWidget() : Container(); } @@ -174,18 +142,6 @@ class AppScaffold extends StatelessWidget { return Stack( children: [body, isHelp == true ? RobotIcon() : Container()]); } - - void changeCurrentTab(int value) { - if (isFromLandingPage) { - changeTab(value); - } else { - Navigator.pushAndRemoveUntil( - AppGlobal.context, - MaterialPageRoute( - builder: (context) => LandingPage(currentTabLocal: value)), - (Route r) => false); - } - } } class AppBarWidget extends StatefulWidget with PreferredSizeWidget { @@ -203,8 +159,6 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { Function(String) badgeUpdater; - final Widget leading; - AppBarWidget( {this.appBarTitle, this.showHomeAppBarIcon, @@ -213,8 +167,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { this.showPharmacyCart = true, this.isOfferPackages = false, this.showOfferPackagesCart = false, - this.isShowDecPage = true, - this.leading}); + this.isShowDecPage = true}); @override State createState() => AppBarWidgetState(); @@ -225,7 +178,6 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { class AppBarWidgetState extends State { String badgeText = "0"; - @override Widget build(BuildContext context) { widget.badgeUpdater = badgeUpdateBlock; @@ -258,12 +210,11 @@ class AppBarWidgetState extends State { fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), - leading: widget.leading ?? - Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), centerTitle: true, actions: [ (widget.isPharmacy && widget.showPharmacyCart) @@ -405,7 +356,6 @@ class _RobotIcon extends State { ))) : Container(), FloatingSearchButton() - ], ) ], @@ -414,10 +364,10 @@ class _RobotIcon extends State { bottom: -15); } -// setAnimation() async { -// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || -// // var animation = -// // IS_TEXT_COMPLETED == ? true : false; + // setAnimation() async { + // /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || + // // var animation = + // // IS_TEXT_COMPLETED == ? true : false; -// } + // } }