merge-requests/296/head
Sultan Khan 4 years ago
parent f2c5c93e2a
commit 8e255f1f22

@ -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<ProjectViewModel>(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<ProjectViewModel>(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<AppBarWidget>{
class AppBarWidgetState extends State<AppBarWidget> {
String badgeText = "0";
@override
Widget build(BuildContext context) {
@ -182,7 +183,7 @@ class AppBarWidgetState extends State<AppBarWidget>{
return buildAppBar(context);
}
badgeUpdateBlock(String value){
badgeUpdateBlock(String value) {
setState(() {
badgeText = value;
});
@ -192,8 +193,9 @@ class AppBarWidgetState extends State<AppBarWidget>{
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<AppBarWidget>{
actions: <Widget>[
(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<AppBarWidget>{
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
(Route<dynamic> 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<RobotIcon> {
],
),
right: -30,
bottom: 50);
bottom: -15);
}
// setAnimation() async {

Loading…
Cancel
Save