|
|
|
|
@ -7,8 +7,6 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/theme/colors.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
@ -68,44 +66,43 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
AppBarWidget appBar;
|
|
|
|
|
final Widget customAppBar;
|
|
|
|
|
|
|
|
|
|
AppScaffold({
|
|
|
|
|
@required this.body,
|
|
|
|
|
this.appBarTitle = '',
|
|
|
|
|
this.isLoading = false,
|
|
|
|
|
this.isShowAppBar = false,
|
|
|
|
|
this.showNewAppBar = false,
|
|
|
|
|
this.showNewAppBarTitle = false,
|
|
|
|
|
this.hasAppBarParam,
|
|
|
|
|
this.bottomSheet,
|
|
|
|
|
this.bottomNavigationBar,
|
|
|
|
|
this.baseViewModel,
|
|
|
|
|
this.floatingActionButton,
|
|
|
|
|
this.isPharmacy = false,
|
|
|
|
|
this.showPharmacyCart = true,
|
|
|
|
|
this.isOfferPackages = false,
|
|
|
|
|
this.showOfferPackagesCart = false,
|
|
|
|
|
this.title,
|
|
|
|
|
this.description,
|
|
|
|
|
this.isShowDecPage = true,
|
|
|
|
|
this.isBottomBar,
|
|
|
|
|
this.backgroundColor,
|
|
|
|
|
this.preferredSize = 0.0,
|
|
|
|
|
this.appBarIcons,
|
|
|
|
|
this.infoList,
|
|
|
|
|
this.isHelp = false,
|
|
|
|
|
this.icon,
|
|
|
|
|
this.showHomeAppBarIcon = true,
|
|
|
|
|
this.imagesInfo,
|
|
|
|
|
this.showDropDown = false,
|
|
|
|
|
this.dropDownList,
|
|
|
|
|
this.dropdownIndexValue,
|
|
|
|
|
this.dropDownIndexChange,
|
|
|
|
|
this.onTap,
|
|
|
|
|
appBar,
|
|
|
|
|
this.customAppBar,
|
|
|
|
|
this.isLocalLoader = false,
|
|
|
|
|
this.backButtonTab
|
|
|
|
|
});
|
|
|
|
|
AppScaffold(
|
|
|
|
|
{@required this.body,
|
|
|
|
|
this.appBarTitle = '',
|
|
|
|
|
this.isLoading = false,
|
|
|
|
|
this.isShowAppBar = false,
|
|
|
|
|
this.showNewAppBar = false,
|
|
|
|
|
this.showNewAppBarTitle = false,
|
|
|
|
|
this.hasAppBarParam,
|
|
|
|
|
this.bottomSheet,
|
|
|
|
|
this.bottomNavigationBar,
|
|
|
|
|
this.baseViewModel,
|
|
|
|
|
this.floatingActionButton,
|
|
|
|
|
this.isPharmacy = false,
|
|
|
|
|
this.showPharmacyCart = true,
|
|
|
|
|
this.isOfferPackages = false,
|
|
|
|
|
this.showOfferPackagesCart = false,
|
|
|
|
|
this.title,
|
|
|
|
|
this.description,
|
|
|
|
|
this.isShowDecPage = true,
|
|
|
|
|
this.isBottomBar,
|
|
|
|
|
this.backgroundColor,
|
|
|
|
|
this.preferredSize = 0.0,
|
|
|
|
|
this.appBarIcons,
|
|
|
|
|
this.infoList,
|
|
|
|
|
this.isHelp = false,
|
|
|
|
|
this.icon,
|
|
|
|
|
this.showHomeAppBarIcon = true,
|
|
|
|
|
this.imagesInfo,
|
|
|
|
|
this.showDropDown = false,
|
|
|
|
|
this.dropDownList,
|
|
|
|
|
this.dropdownIndexValue,
|
|
|
|
|
this.dropDownIndexChange,
|
|
|
|
|
this.onTap,
|
|
|
|
|
appBar,
|
|
|
|
|
this.customAppBar,
|
|
|
|
|
this.isLocalLoader = false,
|
|
|
|
|
this.backButtonTab});
|
|
|
|
|
|
|
|
|
|
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
|
|
|
|
|
_onCartClick = onClick;
|
|
|
|
|
@ -133,22 +130,19 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
)
|
|
|
|
|
: (isShowAppBar
|
|
|
|
|
?
|
|
|
|
|
customAppBar != null
|
|
|
|
|
? customAppBar
|
|
|
|
|
:
|
|
|
|
|
|
|
|
|
|
appBar = AppBarWidget(
|
|
|
|
|
appBarTitle: appBarTitle,
|
|
|
|
|
appBarIcons: appBarIcons,
|
|
|
|
|
showHomeAppBarIcon: showHomeAppBarIcon,
|
|
|
|
|
isPharmacy: isPharmacy,
|
|
|
|
|
showPharmacyCart: showPharmacyCart,
|
|
|
|
|
isOfferPackages: isOfferPackages,
|
|
|
|
|
showOfferPackagesCart: showOfferPackagesCart,
|
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
|
backButtonTab: backButtonTab,
|
|
|
|
|
)
|
|
|
|
|
? customAppBar != null
|
|
|
|
|
? customAppBar
|
|
|
|
|
: appBar = AppBarWidget(
|
|
|
|
|
appBarTitle: appBarTitle,
|
|
|
|
|
appBarIcons: appBarIcons,
|
|
|
|
|
showHomeAppBarIcon: showHomeAppBarIcon,
|
|
|
|
|
isPharmacy: isPharmacy,
|
|
|
|
|
showPharmacyCart: showPharmacyCart,
|
|
|
|
|
isOfferPackages: isOfferPackages,
|
|
|
|
|
showOfferPackagesCart: showOfferPackagesCart,
|
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
|
backButtonTab: backButtonTab,
|
|
|
|
|
)
|
|
|
|
|
: null)),
|
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
|
body: SafeArea(
|
|
|
|
|
@ -179,18 +173,7 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildBodyWidget(context) {
|
|
|
|
|
return Stack(children: <Widget>[
|
|
|
|
|
Center(
|
|
|
|
|
child: isLoading
|
|
|
|
|
? CircularProgressIndicator(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
|
|
|
Colors.grey[500],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: body),
|
|
|
|
|
isHelp == true ? RobotIcon() : Container()
|
|
|
|
|
]);
|
|
|
|
|
return Stack(children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -360,11 +343,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
|
icon: Badge(
|
|
|
|
|
position: BadgePosition.topStart(top: -15, start: -10),
|
|
|
|
|
badgeContent: Text(
|
|
|
|
|
orderPreviewViewModel.cartResponse.quantityCount.toString() /*_badgeText*/,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 9,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.normal),
|
|
|
|
|
orderPreviewViewModel.cartResponse.quantityCount.toString() /*_badgeText*/,
|
|
|
|
|
style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal),
|
|
|
|
|
),
|
|
|
|
|
child: Icon(Icons.shopping_cart)),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|