|
|
|
@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
|
|
|
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/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
@ -29,8 +30,6 @@ import '../progress_indicator/app_loader_widget.dart';
|
|
|
|
import 'arrow_back.dart';
|
|
|
|
import 'arrow_back.dart';
|
|
|
|
import 'network_base_view.dart';
|
|
|
|
import 'network_base_view.dart';
|
|
|
|
import 'not_auh_page.dart';
|
|
|
|
import 'not_auh_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
VoidCallback _onCartClick;
|
|
|
|
VoidCallback _onCartClick;
|
|
|
|
|
|
|
|
|
|
|
|
@ -59,6 +58,8 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
final List<ImagesInfo> imagesInfo;
|
|
|
|
final List<ImagesInfo> imagesInfo;
|
|
|
|
final bool isHelp;
|
|
|
|
final bool isHelp;
|
|
|
|
final bool isLocalLoader;
|
|
|
|
final bool isLocalLoader;
|
|
|
|
|
|
|
|
final Function backButtonTab;
|
|
|
|
|
|
|
|
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,7 +91,9 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
this.showHomeAppBarIcon = true,
|
|
|
|
this.showHomeAppBarIcon = true,
|
|
|
|
this.imagesInfo,
|
|
|
|
this.imagesInfo,
|
|
|
|
appBar,
|
|
|
|
appBar,
|
|
|
|
this.customAppBar, this.isLocalLoader= false});
|
|
|
|
this.customAppBar,
|
|
|
|
|
|
|
|
this.isLocalLoader = false,
|
|
|
|
|
|
|
|
this.backButtonTab});
|
|
|
|
|
|
|
|
|
|
|
|
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
|
|
|
|
AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
|
|
|
|
_onCartClick = onClick;
|
|
|
|
_onCartClick = onClick;
|
|
|
|
@ -115,6 +118,7 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
isOfferPackages: isOfferPackages,
|
|
|
|
isOfferPackages: isOfferPackages,
|
|
|
|
showOfferPackagesCart: showOfferPackagesCart,
|
|
|
|
showOfferPackagesCart: showOfferPackagesCart,
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
isShowDecPage: isShowDecPage,
|
|
|
|
|
|
|
|
backButtonTab: backButtonTab,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
bottomSheet: bottomSheet,
|
|
|
|
@ -146,18 +150,18 @@ class AppScaffold extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
buildBodyWidget(context) {
|
|
|
|
buildBodyWidget(context) {
|
|
|
|
return Stack(
|
|
|
|
return Stack(children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
|
|
|
|
Center(
|
|
|
|
Center(
|
|
|
|
child:isLoading? CircularProgressIndicator(
|
|
|
|
child: isLoading
|
|
|
|
|
|
|
|
? CircularProgressIndicator(
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
|
|
Colors.grey[500],
|
|
|
|
Colors.grey[500],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
):body),
|
|
|
|
)
|
|
|
|
|
|
|
|
: body),
|
|
|
|
|
|
|
|
isHelp == true ? RobotIcon() : Container()
|
|
|
|
isHelp == true ? RobotIcon() : Container()]);
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -174,6 +178,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
|
|
|
|
final bool showOfferPackagesCart;
|
|
|
|
final bool showOfferPackagesCart;
|
|
|
|
final bool isShowDecPage;
|
|
|
|
final bool isShowDecPage;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final Function backButtonTab;
|
|
|
|
Function(String) badgeUpdater;
|
|
|
|
Function(String) badgeUpdater;
|
|
|
|
|
|
|
|
|
|
|
|
AppBarWidget(
|
|
|
|
AppBarWidget(
|
|
|
|
@ -184,6 +189,7 @@ 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.backButtonTab,
|
|
|
|
this.isShowDecPage = true});
|
|
|
|
this.isShowDecPage = true});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -210,6 +216,8 @@ class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
Widget buildAppBar(BuildContext context) {
|
|
|
|
Widget buildAppBar(BuildContext context) {
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
return AppBar(
|
|
|
|
return AppBar(
|
|
|
|
elevation: 0,
|
|
|
|
elevation: 0,
|
|
|
|
backgroundColor: widget.isPharmacy
|
|
|
|
backgroundColor: widget.isPharmacy
|
|
|
|
@ -230,7 +238,9 @@ class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
|
|
|
|
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
|
|
|
|
leading: Builder(
|
|
|
|
leading: Builder(
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return ArrowBack();
|
|
|
|
return ArrowBack(
|
|
|
|
|
|
|
|
onTap: widget.backButtonTab,
|
|
|
|
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
centerTitle: true,
|
|
|
|
centerTitle: true,
|
|
|
|
@ -253,7 +263,7 @@ class AppBarWidgetState extends State<AppBarWidget> {
|
|
|
|
icon: Badge(
|
|
|
|
icon: Badge(
|
|
|
|
position: BadgePosition.topStart(top: -15, start: -10),
|
|
|
|
position: BadgePosition.topStart(top: -15, start: -10),
|
|
|
|
badgeContent: Text(
|
|
|
|
badgeContent: Text(
|
|
|
|
_badgeText,
|
|
|
|
orderPreviewViewModel.cartResponse.quantityCount.toString() /*_badgeText*/,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 9,
|
|
|
|
fontSize: 9,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
@ -385,10 +395,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;
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|