|
|
|
@ -12,7 +12,9 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.da
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/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/others/bottom_bar.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
@ -44,6 +46,7 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
final BaseViewModel baseViewModel;
|
|
|
|
final BaseViewModel baseViewModel;
|
|
|
|
final bool isBottomBar;
|
|
|
|
final bool isBottomBar;
|
|
|
|
final Widget floatingActionButton;
|
|
|
|
final Widget floatingActionButton;
|
|
|
|
|
|
|
|
final FloatingActionButtonLocation floatingActionButtonLocation;
|
|
|
|
final bool isPharmacy;
|
|
|
|
final bool isPharmacy;
|
|
|
|
final bool isOfferPackages;
|
|
|
|
final bool isOfferPackages;
|
|
|
|
final bool showPharmacyCart;
|
|
|
|
final bool showPharmacyCart;
|
|
|
|
@ -58,10 +61,19 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
final List<Widget> appBarIcons;
|
|
|
|
final List<Widget> appBarIcons;
|
|
|
|
final List<ImagesInfo> imagesInfo;
|
|
|
|
final List<ImagesInfo> imagesInfo;
|
|
|
|
final bool isHelp;
|
|
|
|
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 =
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
|
|
AppBarWidget appBar;
|
|
|
|
AppBarWidget appBar;
|
|
|
|
|
|
|
|
|
|
|
|
AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
{@required this.body,
|
|
|
|
{@required this.body,
|
|
|
|
this.appBarTitle = '',
|
|
|
|
this.appBarTitle = '',
|
|
|
|
@ -85,7 +97,14 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
this.infoList,
|
|
|
|
this.infoList,
|
|
|
|
this.isHelp = false,
|
|
|
|
this.isHelp = false,
|
|
|
|
this.showHomeAppBarIcon = true,
|
|
|
|
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) {
|
|
|
|
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
|
|
|
|
_onCartClick = onClick;
|
|
|
|
_onCartClick = onClick;
|
|
|
|
@ -98,6 +117,7 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor:
|
|
|
|
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
|
|
|
drawer: isShowDrawer ? SafeArea(child: AppDrawer()) : null,
|
|
|
|
appBar: isShowAppBar
|
|
|
|
appBar: isShowAppBar
|
|
|
|
? appBar = AppBarWidget(
|
|
|
|
? appBar = AppBarWidget(
|
|
|
|
appBarTitle: appBarTitle,
|
|
|
|
appBarTitle: appBarTitle,
|
|
|
|
@ -108,9 +128,16 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
isOfferPackages: isOfferPackages,
|
|
|
|
isOfferPackages: isOfferPackages,
|
|
|
|
showOfferPackagesCart: showOfferPackagesCart,
|
|
|
|
showOfferPackagesCart: showOfferPackagesCart,
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
|
|
|
|
leading: leading,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
|
|
|
|
bottomNavigationBar: isShowBottomNavBar
|
|
|
|
|
|
|
|
? BottomNavBar(
|
|
|
|
|
|
|
|
changeIndex: changeCurrentTab,
|
|
|
|
|
|
|
|
index: currentTab,
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: null,
|
|
|
|
body: SafeArea(
|
|
|
|
body: SafeArea(
|
|
|
|
top: true,
|
|
|
|
top: true,
|
|
|
|
bottom: true,
|
|
|
|
bottom: true,
|
|
|
|
@ -131,6 +158,7 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
: buildBodyWidget(context),
|
|
|
|
: buildBodyWidget(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
floatingActionButton: floatingActionButton,
|
|
|
|
floatingActionButton: floatingActionButton,
|
|
|
|
|
|
|
|
floatingActionButtonLocation: floatingActionButtonLocation,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -142,6 +170,20 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
return Stack(
|
|
|
|
return Stack(
|
|
|
|
children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
|
|
|
|
children: <Widget>[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<dynamic> r) => false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
|
|
|
|
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
|
|
|
|
@ -159,6 +201,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
|
|
|
|
|
|
|
|
|
|
|
|
Function(String) badgeUpdater;
|
|
|
|
Function(String) badgeUpdater;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final Widget leading;
|
|
|
|
|
|
|
|
|
|
|
|
AppBarWidget(
|
|
|
|
AppBarWidget(
|
|
|
|
{this.appBarTitle,
|
|
|
|
{this.appBarTitle,
|
|
|
|
this.showHomeAppBarIcon,
|
|
|
|
this.showHomeAppBarIcon,
|
|
|
|
@ -167,7 +211,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
|
|
|
|
this.showPharmacyCart = true,
|
|
|
|
this.showPharmacyCart = true,
|
|
|
|
this.isOfferPackages = false,
|
|
|
|
this.isOfferPackages = false,
|
|
|
|
this.showOfferPackagesCart = false,
|
|
|
|
this.showOfferPackagesCart = false,
|
|
|
|
this.isShowDecPage = true});
|
|
|
|
this.isShowDecPage = true,
|
|
|
|
|
|
|
|
this.leading});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() => AppBarWidgetState();
|
|
|
|
State<StatefulWidget> createState() => AppBarWidgetState();
|
|
|
|
@ -178,6 +223,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
String badgeText = "0";
|
|
|
|
String badgeText = "0";
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
widget.badgeUpdater = badgeUpdateBlock;
|
|
|
|
widget.badgeUpdater = badgeUpdateBlock;
|
|
|
|
@ -210,11 +256,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Theme.of(context).textTheme.headline1.color,
|
|
|
|
color: Theme.of(context).textTheme.headline1.color,
|
|
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
|
|
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
|
|
|
|
leading: Builder(
|
|
|
|
leading: widget.leading ??
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
Builder(
|
|
|
|
return ArrowBack();
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
},
|
|
|
|
return ArrowBack();
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
centerTitle: true,
|
|
|
|
centerTitle: true,
|
|
|
|
actions: <Widget>[
|
|
|
|
actions: <Widget>[
|
|
|
|
(widget.isPharmacy && widget.showPharmacyCart)
|
|
|
|
(widget.isPharmacy && widget.showPharmacyCart)
|
|
|
|
@ -364,10 +411,10 @@ class _RobotIcon extends State<RobotIcon> {
|
|
|
|
bottom: -15);
|
|
|
|
bottom: -15);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// setAnimation() async {
|
|
|
|
// setAnimation() async {
|
|
|
|
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
|
|
|
|
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
|
|
|
|
// // var animation =
|
|
|
|
// // var animation =
|
|
|
|
// // IS_TEXT_COMPLETED == ? true : false;
|
|
|
|
// // IS_TEXT_COMPLETED == ? true : false;
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|