diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 4b24af8a..ca72e267 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -87,7 +87,7 @@ class AppScaffold extends StatelessWidget { this.showHomeAppBarIcon = true, this.imagesInfo}); - AppScaffold setOnAppBarCartClick(VoidCallback onClick){ + AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; return this; } @@ -112,21 +112,23 @@ class AppScaffold extends StatelessWidget { : null, bottomSheet: bottomSheet, body: SafeArea( - top: true, bottom: true, - 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, - ) - : buildBodyWidget(context), + top: true, + bottom: true, + 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, + ) + : buildBodyWidget(context), ), ); } @@ -173,8 +175,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { Size get preferredSize => Size(double.maxFinite, 60); } -class AppBarWidgetState extends State{ - +class AppBarWidgetState extends State { String badgeText = "0"; @override Widget build(BuildContext context) { @@ -182,7 +183,7 @@ class AppBarWidgetState extends State{ return buildAppBar(context); } - badgeUpdateBlock(String value){ + badgeUpdateBlock(String value) { setState(() { badgeText = value; }); @@ -192,8 +193,9 @@ 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, @@ -216,38 +218,32 @@ class AppBarWidgetState extends State{ actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( - badgeContent: Text( - badgeText - ), - child: Icon(Icons.shopping_cart) - ), - color: Colors.white, - onPressed: () { - Navigator.of(context).popUntil(ModalRoute.withName('/')); - }) + icon: Badge( + badgeContent: Text(badgeText), + child: Icon(Icons.shopping_cart)), + color: Colors.white, + onPressed: () { + Navigator.of(context).popUntil(ModalRoute.withName('/')); + }) : Container(), - (widget.isOfferPackages && widget.showOfferPackagesCart) ? IconButton( - icon: Badge( - - position: BadgePosition.topStart(top: -15,start: -10), - badgeContent: Text( - badgeText, - style: TextStyle(fontSize: 9,color: Colors.white, fontWeight: FontWeight.normal), - ), - child: Icon(Icons.shopping_cart) - ), - color: Colors.white, - onPressed: () { - // Cart Click Event - if(_onCartClick != null) - _onCartClick(); - - }) + icon: Badge( + position: BadgePosition.topStart(top: -15, start: -10), + badgeContent: Text( + badgeText, + style: TextStyle( + fontSize: 9, + color: Colors.white, + fontWeight: FontWeight.normal), + ), + child: Icon(Icons.shopping_cart)), + color: Colors.white, + onPressed: () { + // Cart Click Event + if (_onCartClick != null) _onCartClick(); + }) : Container(), - if (widget.showHomeAppBarIcon) IconButton( icon: Icon(FontAwesomeIcons.home), @@ -256,11 +252,10 @@ class AppBarWidgetState extends State{ Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (context) => LandingPage()), - (Route r) => false); + (Route r) => false); // Cart Click Event - if(_onCartClick != null) - _onCartClick(); + if (_onCartClick != null) _onCartClick(); }, ), if (widget.appBarIcons != null) ...widget.appBarIcons @@ -356,7 +351,7 @@ class _RobotIcon extends State { ], ), right: -30, - bottom: 50); + bottom: -15); } // setAnimation() async {