Merge branch 'foote_in_all_pages' into 'development'

Foote in all pages

See merge request Cloud_Solution/diplomatic-quarter!369
merge-requests/372/merge
Mohammad Aljammal 3 years ago
commit 68491631f3

@ -40,6 +40,7 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
return AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: ScrollPhysics(),

@ -65,6 +65,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(

@ -71,6 +71,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
isShowBottomNavBar: false,
body: Stack(
children: [
PlacePicker(

@ -51,6 +51,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -93,6 +93,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
onModelReady: (model) => model.getRelationTypes(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -52,6 +52,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
return BaseView<EReferralViewModel>(
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -60,6 +60,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
onModelReady: (model) => model.getAllCities(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -38,6 +38,7 @@ class _EReferralPageState extends State<EReferralPage>
return BaseView<EReferralViewModel>(
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).ereferral,
description: TranslationBase.of(context).eReferralInfo,
imagesInfo: [

@ -47,6 +47,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
onModelReady: (model) => model.getAllCities(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -52,6 +52,7 @@ class _NewHomeHealthCareStepOnePageState
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -71,6 +71,7 @@ class _NewHomeHealthCareStepThreePageState
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(

@ -74,6 +74,7 @@ class _NewHomeHealthCareStepTowPageState
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
isShowBottomNavBar: false,
body: Stack(
children: [
PlacePicker(

@ -1,69 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'home_health_care_page.dart';
class HomeHealthCareIndexPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).serviceInformation,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
TranslationBase.of(context).homeHealthCare,
fontWeight: FontWeight.normal,
fontSize: 25,
color: Color(0xff60686b),
),
SizedBox(
height: 12,
),
Texts(
TranslationBase.of(context).homeHealthCareText,
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: Image.asset(
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
SizedBox(
height: 77,
),
],
)),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.push(
context,
FadePage(
page: HomeHealthCarePage(),
),
),
label: TranslationBase.of(context).loginRegister,
textColor: Theme.of(context).backgroundColor),
),
],
),
));
}
}

@ -51,6 +51,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold(
isShowAppBar: false,
baseViewModel: model,
isShowBottomNavBar: false,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(

@ -169,7 +169,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
Navigator.push(
context,
FadePage(
page: MedicalProfilePage(),
page: MedicalProfilePage(isFromAllServicePage: true),
),
);
},

@ -13,6 +13,7 @@ class H2OPageIndexPage extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
//isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).serviceInformation,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),

@ -48,6 +48,7 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
onModelReady: (model) => model.getUserDetail(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).waterTracker,
showHomeAppBarIcon: false,
baseViewModel: model,

@ -19,6 +19,8 @@ class MonthPage extends StatelessWidget {
onModelReady: (model) => model.getUserProgressForMonthData(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: Padding(

@ -22,6 +22,7 @@ class TodayPage extends StatelessWidget {
onModelReady: (model) => model.getUserProgressForTodayData(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: SingleChildScrollView(

@ -19,6 +19,7 @@ class WeekPage extends StatelessWidget {
onModelReady: (model) => model.getUserProgressForWeekData(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: Padding(

@ -32,6 +32,8 @@ class _BookingOptionsState extends State<BookingOptions> {
return AppScaffold(
isShowAppBar: widget.isAppbar,
isShowDecPage: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),

@ -68,6 +68,7 @@ class _DoctorProfileState extends State<DoctorProfile>
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true,
isShowBottomNavBar: false,
isShowDecPage: false,
bottomSheet: showFooterButton
? Container(

@ -41,6 +41,7 @@ class _LiveChatPageState extends State<LiveChatPage>
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowBottomNavBar: false,
imagesInfo: imagesInfo,
title: TranslationBase.of(context).liveChat,
description: TranslationBase.of(context).infoChat,

@ -39,6 +39,7 @@ class _FindUsPageState extends State<FindUsPage>
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
appBarTitle: 'Locations',
baseViewModel: model,
body: Scaffold(

@ -38,7 +38,10 @@ import 'package:provider/provider.dart';
class MyFamily extends StatefulWidget {
final bool isAppbarVisible;
MyFamily({this.isAppbarVisible = true});
final bool isFromAllServicePage;
MyFamily({this.isAppbarVisible = true, this.isFromAllServicePage = false});
@override
_MyFamily createState() => _MyFamily();
}
@ -92,6 +95,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
isShowAppBar: widget.isAppbarVisible,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).familyInfo,
isShowBottomNavBar: widget.isFromAllServicePage,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(

@ -51,6 +51,7 @@ class _AmbulanceReqState extends State<AmbulanceReq>
onModelReady: (model) => model.getAmRequestOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).transportationService,
description: TranslationBase.of(context).infoAmbulance,
imagesInfo: imagesInfo,

@ -57,6 +57,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
return AppScaffold(
appBarTitle: widget.appo.doctorNameObj,
isShowAppBar: true,
isShowBottomNavBar: false,
bottomSheet: AppointmentDetails.showFooterButton
? Container(
width: MediaQuery.of(context).size.width,

@ -81,6 +81,8 @@ class _ToDoState extends State<ToDo> {
isShowAppBar: widget.isShowAppBar,
isShowDecPage: true,
description: TranslationBase.of(context).infoTodo,
isShowBottomNavBar: false,
body: SingleChildScrollView(
child: Column(
children: <Widget>[

@ -42,6 +42,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
isShowAppBar: true,
isBottomBar: false,
isShowDecPage: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).feedbackTitle,
body: Scaffold(
extendBodyBehindAppBar: true,

@ -50,6 +50,7 @@ class _HomePageState extends State<HomePage> {
builder: (_, model, wi) => AppScaffold(
isShowDecPage: false,
isHelp: true,
isShowBottomNavBar: false,
body: Container(
width: double.infinity,
child: SingleChildScrollView(

@ -32,6 +32,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
@ -49,8 +50,11 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class LandingPage extends StatefulWidget {
static LandingPage shared;
int currentTab = 0;
_LandingPageState state;
LandingPage() {
LandingPage({currentTabLocal}) {
currentTab = currentTabLocal ?? 0;
LandingPage.shared = this;
}
@ -69,7 +73,6 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var authProvider = new AuthProvider();
int currentTab = 0;
PageController pageController;
ProjectViewModel projectViewModel;
ToDoCountProviderModel model;
@ -102,7 +105,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeCurrentTab(int tab) {
setState(() {
if (currentTab > 0 && tab == 2)
if (widget.currentTab > 0 && tab == 2)
pageController.jumpToPage(0);
else if (tab != 0) {
if (tab == 4 && model.count == 0) {
@ -116,7 +119,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController.jumpToPage(tab);
}
currentTab = tab;
widget.currentTab = tab;
});
}
@ -175,7 +178,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
AppGlobal.context = context;
_requestIOSPermissions();
pageController = PageController(keepPage: true);
pageController =
PageController(keepPage: true, initialPage: widget.currentTab);
_firebaseMessaging.setAutoInitEnabled(true);
locationUtils =
@ -484,94 +488,84 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
projectViewModel = Provider.of(context);
model = Provider.of<ToDoCountProviderModel>(context);
return Scaffold(
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6: TextStyle(
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold),
),
title: Text(
getText(currentTab).toUpperCase(),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
// bold: true,
// color: Colors.white,
),
leading: Builder(
builder: (BuildContext context) {
return new Stack(
children: <Widget>[
currentTab == 0
? IconButton(
icon: Icon(Icons.menu),
color: Theme.of(context).textTheme.headline1.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
icon: Icon(Icons.arrow_back),
color: Theme.of(context).textTheme.headline1.color,
onPressed: () {
setState(() {
currentTab = 0;
});
pageController.jumpToPage(0);
},
),
notificationCount != ''
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
return AppScaffold(
isShowAppBar: true,
showHomeAppBarIcon: false,
appBarTitle: getText(widget.currentTab).toUpperCase(),
leading: Builder(
builder: (BuildContext context) {
return new Stack(
children: <Widget>[
widget.currentTab == 0
? IconButton(
icon: Icon(Icons.menu),
color: Theme.of(context).textTheme.headline1.color,
onPressed: () => Scaffold.of(context).openDrawer(),
)
: IconButton(
icon: Icon(Icons.arrow_back),
color: Theme.of(context).textTheme.headline1.color,
onPressed: () {
setState(() {
widget.currentTab = 0;
});
pageController.jumpToPage(0);
},
),
notificationCount != ''
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
)
: SizedBox()
],
);
},
),
actions: [
IconButton(
//iconSize: 70,
icon: Icon(
projectViewModel.isLogin ? Icons.settings : Icons.login,
color: Theme.of(context).textTheme.headline1.color,
),
onPressed: () {
if (projectViewModel.isLogin)
Navigator.of(context).pushNamed(
SETTINGS,
);
else
login();
}, //do something,
)
],
centerTitle: true,
),
)
: SizedBox()
],
);
},
),
drawer: SafeArea(child: AppDrawer()),
extendBody: true,
isShowDrawer: true,
appBarIcons: [
IconButton(
//iconSize: 70,
icon: Icon(
projectViewModel.isLogin ? Icons.settings : Icons.login,
color: Theme.of(context).textTheme.headline1.color,
),
onPressed: () {
if (projectViewModel.isLogin)
Navigator.of(context).pushNamed(
SETTINGS,
);
else
login();
}, //do something,
)
],
// drawer: SafeArea(child: AppDrawer()),
// extendBody: true,
isShowDecPage: false,
changeTab: changeCurrentTab,
isFromLandingPage: true,
currentTab: widget.currentTab,
body: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
@ -587,13 +581,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(
changeIndex: changeCurrentTab,
index: currentTab,
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton:
(projectViewModel.havePrivilege(34) && currentTab == 0)
(projectViewModel.havePrivilege(34) && widget.currentTab == 0)
? FloatingButton(
elevation: true,
onTap: () {

@ -110,35 +110,6 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
centerTitle: true,
)
: null,
// : AppBar(
// backgroundColor: Color(0xff5AB145),
// elevation: 0,
// textTheme: TextTheme(
// headline6: TextStyle(
// color: Colors.white, fontWeight: FontWeight.bold),
// ),
// title: Text(getText(currentTab).toUpperCase()),
// leading: Builder(
// builder: (BuildContext context) {
// return IconButton(
// icon: Icon(Icons.arrow_back),
// color: Colors.white,
// onPressed: () => Scaffold.of(context).openDrawer(),
// );
// },
// ),
// actions: [
// // IconButton(
// // iconSize: 70,
// // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
// // height: 100, width: 100, fit: BoxFit.cover),
// // onPressed: () {
// // triggerRobot();
// // } //do something,
// // )
// ],
// centerTitle: true,
// ),
extendBody: false,
body: PageView(
physics: NeverScrollableScrollPhysics(),

@ -51,6 +51,7 @@ class _LiveCareHomeState extends State<LiveCareHome>
return AppScaffold(
appBarTitle: "LiveCare",
isShowAppBar: true,
isShowBottomNavBar: false,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).erConsultation,
body: Container(

@ -101,6 +101,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(20),

@ -31,6 +31,7 @@ class _ForgotPassword extends State<ForgotPassword> {
appBarTitle: TranslationBase.of(context).forgotFileNoTitle,
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20),

@ -21,6 +21,7 @@ class LoginType extends StatelessWidget {
appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
child: Container(
padding:

@ -85,6 +85,7 @@ class _Login extends State<Login> {
appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),

@ -74,6 +74,7 @@ class _RegisterInfo extends State<RegisterInfo> {
appBarTitle: TranslationBase.of(context).register,
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
padding: EdgeInsets.all(20),
child: Column(children: <Widget>[

@ -49,6 +49,7 @@ class _Register extends State<Register> {
appBarTitle: TranslationBase.of(context).register,
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),

@ -30,6 +30,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
appBarTitle: TranslationBase.of(context).welcome,
isShowDecPage: false,
isShowAppBar: true,
isShowBottomNavBar: false,
body: Padding(
padding: EdgeInsets.all(20),
child: Column(

@ -39,6 +39,7 @@ class _AskDoctorHomPageState extends State<AskDoctorHomPage>
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).askDoctor,
body: Scaffold(
extendBodyBehindAppBar: true,

@ -44,6 +44,7 @@ class _EyeHomePageState extends State<EyeHomePage>
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).measurements,
body: Scaffold(
extendBodyBehindAppBar: true,

@ -13,6 +13,10 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MedicalProfilePage extends StatefulWidget {
final bool isFromAllServicePage;
const MedicalProfilePage({ this.isFromAllServicePage = false}) ;
@override
_MedicalProfilePageState createState() => _MedicalProfilePageState();
}
@ -25,6 +29,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(
projectViewModel: projectViewModel,
@ -33,10 +38,12 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
isLogin: projectViewModel.isLogin);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold(
builder: (_, model, x) => AppScaffold(
isShowDecPage: false,
baseViewModel: model,
isHelp: true,
isShowBottomNavBar: widget.isFromAllServicePage,
body: Container(
child: SingleChildScrollView(
child: Column(

@ -42,6 +42,7 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [
IconButton(
@ -100,26 +101,29 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
)
],
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor,
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
floatingActionButton: Container(
margin: EdgeInsets.only(bottom: 70),
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).primaryColor,
),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
),

@ -42,6 +42,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage>
onModelReady: (model) => model.getBloodPressure(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).bloodPressure,
baseViewModel: model,
appBarIcons: [IconButton(
@ -94,19 +95,22 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage>
)
],
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
floatingActionButton: Container(
margin: EdgeInsets.only(bottom: 70),
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
),

@ -47,6 +47,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
return BaseView<BloodSugarViewMode>(
onModelReady: (model) => model.getBloodSugar(),
builder: (_, model, w) => AppScaffold(
isShowBottomNavBar: false,
appBarIcons: [IconButton(
icon: Icon(Icons.email),
color: Colors.white,
@ -105,19 +106,22 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
)
],
),
floatingActionButton: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color:Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
floatingActionButton: Container(
margin: EdgeInsets.only(bottom: 70),
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,)));
},
child: Container(
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color:Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
),
),
),
),

@ -47,6 +47,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
description: TranslationBase.of(context).infoPrescriptions,
infoList: TranslationBase.of(context).infoPrescriptionsPoints,
imagesInfo: imagesInfo,
isShowBottomNavBar: false,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(

@ -59,6 +59,7 @@ class _HomeReportPageState extends State<HomeReportPage>
onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
isShowBottomNavBar: false,
appBarTitle: TranslationBase.of(context).newMedReport,
title: TranslationBase.of(context).medReport,
description: TranslationBase.of(context).infoMonthReport,

@ -44,6 +44,7 @@ class _StepsTrackerState extends State<StepsTracker>
isShowAppBar: true,
appBarTitle: "Steps",
isShowDecPage: false,
isShowBottomNavBar: false,
body: Container(
child: Column(
mainAxisSize: MainAxisSize.min,

@ -80,6 +80,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
isShowAppBar: false,
isShowDecPage: false,
baseViewModel: model,
isPharmacy:true,
backgroundColor: Colors.white,
body: Container(
width: double.infinity,

@ -35,6 +35,7 @@ class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
AppScaffold(
isShowDecPage: false,
baseViewModel: model,
isPharmacy:true,
body: Column(
children: [
Expanded(

@ -12,7 +12,9 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.da
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.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/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -44,6 +46,7 @@ class AppScaffold extends StatelessWidget {
final BaseViewModel baseViewModel;
final bool isBottomBar;
final Widget floatingActionButton;
final FloatingActionButtonLocation floatingActionButtonLocation;
final bool isPharmacy;
final bool isOfferPackages;
final bool showPharmacyCart;
@ -58,10 +61,19 @@ class AppScaffold extends StatelessWidget {
final List<Widget> appBarIcons;
final List<ImagesInfo> imagesInfo;
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 =
locator<AuthenticatedUserObject>();
AppBarWidget appBar;
AppScaffold(
{@required this.body,
this.appBarTitle = '',
@ -85,7 +97,14 @@ class AppScaffold extends StatelessWidget {
this.infoList,
this.isHelp = false,
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) {
_onCartClick = onClick;
@ -98,6 +117,7 @@ class AppScaffold extends StatelessWidget {
return Scaffold(
backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
drawer: isShowDrawer ? SafeArea(child: AppDrawer()) : null,
appBar: isShowAppBar
? appBar = AppBarWidget(
appBarTitle: appBarTitle,
@ -108,15 +128,21 @@ class AppScaffold extends StatelessWidget {
isOfferPackages: isOfferPackages,
showOfferPackagesCart: showOfferPackagesCart,
isShowDecPage: isShowDecPage,
leading: leading,
)
: null,
bottomSheet: bottomSheet,
bottomNavigationBar: isShowBottomNavBar && !getIsShowDecPageValue(context) && !isPharmacy
? BottomNavBar(
changeIndex: changeCurrentTab,
index: currentTab,
)
: null,
body: SafeArea(
top: true,
bottom: true,
child:
(!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage)
getIsShowDecPageValue(context)
? NotAutPage(
title: title ?? appBarTitle,
description: description,
@ -131,9 +157,15 @@ class AppScaffold extends StatelessWidget {
: buildBodyWidget(context),
),
floatingActionButton: floatingActionButton,
floatingActionButtonLocation: floatingActionButtonLocation,
);
}
getIsShowDecPageValue(context){
return (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage);
}
buildAppLoaderWidget(bool isLoading) {
return isLoading ? AppLoaderWidget() : Container();
}
@ -142,6 +174,18 @@ class AppScaffold extends StatelessWidget {
return Stack(
children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
}
void changeCurrentTab(int value) {
if (isFromLandingPage) {
changeTab(value);
} else {
Navigator.pushAndRemoveUntil(
AppGlobal.context,
MaterialPageRoute(
builder: (context) => LandingPage(currentTabLocal: value)),
(Route<dynamic> r) => false);
}
}
}
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
@ -159,6 +203,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
Function(String) badgeUpdater;
final Widget leading;
AppBarWidget(
{this.appBarTitle,
this.showHomeAppBarIcon,
@ -167,7 +213,8 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
this.showPharmacyCart = true,
this.isOfferPackages = false,
this.showOfferPackagesCart = false,
this.isShowDecPage = true});
this.isShowDecPage = true,
this.leading});
@override
State<StatefulWidget> createState() => AppBarWidgetState();
@ -178,6 +225,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
class AppBarWidgetState extends State<AppBarWidget> {
String badgeText = "0";
@override
Widget build(BuildContext context) {
widget.badgeUpdater = badgeUpdateBlock;
@ -210,11 +258,12 @@ class AppBarWidgetState extends State<AppBarWidget> {
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.headline1.color,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
leading: widget.leading ??
Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
actions: <Widget>[
(widget.isPharmacy && widget.showPharmacyCart)
@ -356,6 +405,7 @@ class _RobotIcon extends State<RobotIcon> {
)))
: Container(),
FloatingSearchButton()
],
)
],
@ -364,10 +414,10 @@ class _RobotIcon extends State<RobotIcon> {
bottom: -15);
}
// setAnimation() async {
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
// // var animation =
// // IS_TEXT_COMPLETED == ? true : false;
// setAnimation() async {
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
// // var animation =
// // IS_TEXT_COMPLETED == ? true : false;
// }
// }
}

Loading…
Cancel
Save