From db840906942255053e52135387f76e41a3e409d3 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 20 Jun 2021 15:12:57 +0300 Subject: [PATCH] PAP-872 & PAP-593 fixed, Water addition was not visible. --- lib/widgets/others/app_scaffold_widget.dart | 84 +++++++-------------- 1 file changed, 27 insertions(+), 57 deletions(-) diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index ca72e267..1412adf6 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -58,8 +58,7 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final List imagesInfo; final bool isHelp; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; AppScaffold( @@ -96,8 +95,7 @@ class AppScaffold extends StatelessWidget { Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( - backgroundColor: - backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, appBar: isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -114,22 +112,21 @@ class AppScaffold extends StatelessWidget { body: SafeArea( top: true, bottom: true, - child: - (!Provider.of(context, listen: false).isLogin && - isShowDecPage) - ? NotAutPage( - title: title ?? appBarTitle, - description: description, - infoList: infoList, - imagesInfo: imagesInfo, + child: (!Provider.of(context, listen: false).isLogin && isShowDecPage) + ? NotAutPage( + title: title ?? appBarTitle, + description: description, + infoList: infoList, + imagesInfo: imagesInfo, + ) + : baseViewModel != null + ? NetworkBaseView( + child: buildBodyWidget(context), + baseViewModel: baseViewModel, ) - : baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(context), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(context), + : buildBodyWidget(context), ), + floatingActionButton: floatingActionButton, ); } @@ -138,14 +135,12 @@ class AppScaffold extends StatelessWidget { } buildBodyWidget(context) { - return Stack( - children: [body, isHelp == true ? RobotIcon() : Container()]); + return Stack(children: [body, isHelp == true ? RobotIcon() : Container()]); } } class AppBarWidget extends StatefulWidget with PreferredSizeWidget { - final AuthenticatedUserObject authenticatedUserObject = - locator(); + final AuthenticatedUserObject authenticatedUserObject = locator(); final String appBarTitle; final bool showHomeAppBarIcon; @@ -193,22 +188,12 @@ class AppBarWidgetState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppBar( elevation: 0, - backgroundColor: widget.isPharmacy - ? Colors.green - : Theme.of(context).appBarTheme.color, + backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), + headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), ), - title: Text( - widget.authenticatedUserObject.isLogin || !widget.isShowDecPage - ? widget.appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle, + style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack(); @@ -218,9 +203,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( - badgeContent: Text(badgeText), - child: Icon(Icons.shopping_cart)), + icon: Badge(badgeContent: Text(badgeText), child: Icon(Icons.shopping_cart)), color: Colors.white, onPressed: () { Navigator.of(context).popUntil(ModalRoute.withName('/')); @@ -232,10 +215,7 @@ class AppBarWidgetState extends State { position: BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( badgeText, - style: TextStyle( - fontSize: 9, - color: Colors.white, - fontWeight: FontWeight.normal), + style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), ), child: Icon(Icons.shopping_cart)), color: Colors.white, @@ -249,10 +229,7 @@ class AppBarWidgetState extends State { icon: Icon(FontAwesomeIcons.home), color: Colors.white, onPressed: () { - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route r) => false); + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); // Cart Click Event if (_onCartClick != null) _onCartClick(); @@ -316,18 +293,11 @@ class _RobotIcon extends State { ], ), child: TyperAnimatedTextKit( - text: Provider.of(context, - listen: false) - .isArabic == - true + text: Provider.of(context, listen: false).isArabic == true ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", - textLength: Provider.of(context, - listen: false) - .isArabic == - true - ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - .length + textLength: Provider.of(context, listen: false).isArabic == true + ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file." .length)) : Container(),