done dashboard page

merge-requests/34/head
Mohammad Aljammal 6 years ago
parent 895c09efa4
commit 01a011a03d

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 626 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

@ -326,7 +326,7 @@ const Map<String, Map<String, String>> localizedValues = {
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'}, "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'},
"EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'},
"OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني'}, "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني'},
"OffersAndPackages": {"en": "Offers and Packages", 'ar': 'العروض والباقات'}, "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'},
"ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'}, "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'},
"HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'}, "HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'},
"ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'}, "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'},
@ -346,5 +346,6 @@ const Map<String, Map<String, String>> localizedValues = {
"gate":{"en":"Gate:","ar":"بوابة"}, "gate":{"en":"Gate:","ar":"بوابة"},
"building":{"en":"Building:","ar":"المبنى"}, "building":{"en":"Building:","ar":"المبنى"},
"branch":{"en":"Branch:","ar":"الفرع"}, "branch":{"en":"Branch:","ar":"الفرع"},
"emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"},
}; };

@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
class BaseViewModel extends ChangeNotifier { class BaseViewModel extends ChangeNotifier {
ViewState _state = ViewState.Idle; ViewState _state = ViewState.Idle;
bool isInternetConnection = true; bool isInternetConnection = true;
bool isLogin = false;
ViewState get state => _state; ViewState get state => _state;
@ -27,6 +28,10 @@ class BaseViewModel extends ChangeNotifier {
_getUser() async { _getUser() async {
var userData = await sharedPref.getObject(USER_PROFILE); var userData = await sharedPref.getObject(USER_PROFILE);
if (userData != null) user = AuthenticatedUser.fromJson(userData); if (userData != null) user = AuthenticatedUser.fromJson(userData);
var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID);
this.isLogin = isLogin != null;
notifyListeners(); notifyListeners();
} }
} }

@ -1,8 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/dashboard_service.dart'; import 'package:diplomaticquarterapp/core/service/dashboard_service.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
VitalSignService _vitalSignService = locator<VitalSignService>();
String weightKg = "";
String heightCm = "";
String bloadType = "";
getPatientRadOrders() async {
if (!isLogin) {
setState(ViewState.Busy);
await _vitalSignService.getPatientRadOrders();
if (_vitalSignService.hasError) {
error = _vitalSignService.error;
setState(ViewState.Error);
} else
_vitalSignService.vitalSignResModelList.forEach((element) {
weightKg = '${element.weightKg}';
heightCm = '${element.heightCm}';
});
setState(ViewState.Idle);
}
}
} }

@ -2,10 +2,11 @@ import 'dart:async';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class ProjectViewModel with ChangeNotifier { class ProjectViewModel extends BaseViewModel {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
Locale _appLocale; Locale _appLocale;
String currentLanguage = 'ar'; String currentLanguage = 'ar';

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class AuthenticatedUser { class AuthenticatedUser {
String setupID; String setupID;
int patientType; int patientType;
@ -11,6 +13,7 @@ class AuthenticatedUser {
int relationshipID; int relationshipID;
int gender; int gender;
String dateofBirth; String dateofBirth;
DateTime dateofBirthDataTime;
dynamic dateofBirthN; dynamic dateofBirthN;
String nationalityID; String nationalityID;
dynamic phoneResi; dynamic phoneResi;
@ -135,6 +138,7 @@ class AuthenticatedUser {
relationshipID = json['RelationshipID']; relationshipID = json['RelationshipID'];
gender = json['Gender']; gender = json['Gender'];
dateofBirth = json['DateofBirth']; dateofBirth = json['DateofBirth'];
dateofBirthDataTime = DateUtil.convertStringToDate(json['DateofBirth']);
dateofBirthN = json['DateofBirthN']; dateofBirthN = json['DateofBirthN'];
nationalityID = json['NationalityID']; nationalityID = json['NationalityID'];
phoneResi = json['PhoneResi']; phoneResi = json['PhoneResi'];

@ -1,6 +1,9 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -12,6 +15,10 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final Function goToMyProfile;
HomePage({Key key, this.goToMyProfile});
@override @override
_HomePageState createState() => _HomePageState(); _HomePageState createState() => _HomePageState();
} }
@ -20,300 +27,497 @@ class _HomePageState extends State<HomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return BaseView<DashboardViewModel>(
body: Container( onModelReady: (model) => model.getPatientRadOrders(),
width: double.infinity, builder: (_, model, wi) => AppScaffold(
child: SingleChildScrollView( body: Container(
child: Column( width: double.infinity,
crossAxisAlignment: CrossAxisAlignment.start, child: SingleChildScrollView(
children: <Widget>[ child: Column(
Stack( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Column( Stack(
children: <Widget>[ children: <Widget>[
Container( Column(
width: double.infinity, children: <Widget>[
height: 210, Container(
decoration: BoxDecoration( width: double.infinity,
image: DecorationImage( height: 210,
image: ExactAssetImage( decoration: BoxDecoration(
'assets/images/timeline_bg.png'), image: DecorationImage(
fit: BoxFit.cover), image: ExactAssetImage(
'assets/images/dashboard_top_bg.png'),
fit: BoxFit.cover),
),
child: Stack(
children: <Widget>[
Positioned(
top: 30,
left: 15,
right: 15,
child: Container(
width:
MediaQuery.of(context).size.width * 0.8,
child: Row(
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: LiveCareHome())),
child: Container(
height: 110,
padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.white
.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: Image.asset(
'assets/images/livecare_white_logo.png',
),
),
),
),
Expanded(
child: Container(
height: 110,
padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color:
Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
// child: Image.asset('assets/images/livecare_white_logo.png',),
),
),
],
),
),
)
],
),
), ),
child: Stack( Container(width: double.infinity, height: 80)
children: <Widget>[ ],
Positioned( ),
top: 30, Positioned(
left: 15, top: 155,
right: 15, left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation ==
Orientation.landscape
? 0.02
: 0.03),
right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation ==
Orientation.landscape
? 0.02
: 0.03),
child: (!model.isLogin && projectViewModel.user == null)
? Container(
width: double.infinity,
height: 125,
decoration: BoxDecoration(
color: Hexcolor('#A59E9E'),
shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover)),
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.8, margin: EdgeInsets.all(5),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded( SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).myMedicalFile,
color: Colors.black87,
bold: true,
fontSize: 23,
),
SizedBox(
height: 5,
),
Texts(
TranslationBase.of(context)
.myMedicalFileSubTitle,
color: Colors.black,
fontSize: 16,
),
Align(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () {
FadePage(page: LiveCareHome())), widget.goToMyProfile();
},
child: Container( child: Container(
height: 110, margin: EdgeInsets.all(2),
margin: EdgeInsets.all(5), width: 90,
height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.transparent color: Hexcolor('#D81A2E'),
.withOpacity(0.3), shape: BoxShape.rectangle,
border: Border.all(
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(9)),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Live care ', TranslationBase.of(context)
.viewMore,
color: Colors.white, color: Colors.white,
fontSize: 12,
), ),
), ),
), ),
), ),
), )
Expanded(
child: Container(
height: 110,
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.transparent
.withOpacity(0.3),
)),
),
], ],
), ),
), ),
) )
], : Container(
), width: double.infinity,
), height: 130,
Container(width: double.infinity, height: 80) decoration: BoxDecoration(
], color: Hexcolor('#A59E9E'),
), shape: BoxShape.rectangle,
Positioned( border: Border.all(
top: 155, color: Colors.transparent, width: 0.5),
left: MediaQuery.of(context).size.width * borderRadius:
(MediaQuery.of(context).orientation == BorderRadius.all(Radius.circular(9)),
Orientation.landscape image: DecorationImage(
? 0.02 image: ExactAssetImage(
: 0.03), 'assets/images/bg_graphic.png'),
right: MediaQuery.of(context).size.width * fit: BoxFit.cover),
(MediaQuery.of(context).orientation == ),
Orientation.landscape child: Container(
? 0.02 margin: EdgeInsets.all(5),
: 0.03), child: Column(
child: Container( children: <Widget>[
width: double.infinity, Row(
height: 125, children: <Widget>[
decoration: BoxDecoration( if (model.user != null)
color: Hexcolor('#A59E9E'), Expanded(
shape: BoxShape.rectangle, child: Column(
border: crossAxisAlignment:
Border.all(color: Colors.transparent, width: 0.5), CrossAxisAlignment.start,
borderRadius: BorderRadius.all(Radius.circular(9)), children: <Widget>[
image: DecorationImage( SizedBox(
image: ExactAssetImage( height: 8,
'assets/images/bg_graphic.png'), ),
fit: BoxFit.cover)), Texts(
child: Container( model.user.firstName +
margin: EdgeInsets.all(5), " " +
child: Column( model.user.lastName,
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.grey[100],
children: <Widget>[ bold: true,
SizedBox( fontSize: 15,
height: 8, ),
), Texts(
Texts( '${model.user.patientID}',
TranslationBase.of(context).myMedicalFile, color: Colors.white,
color: Colors.black87, fontSize: 14,
bold: true, ),
fontSize: 23, SizedBox(
), height: 5,
SizedBox( ),
height: 5, Texts(
), '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}',
Texts( color: Colors.grey[100],
TranslationBase.of(context).myMedicalFileSubTitle, fontWeight: FontWeight.normal,
color: Colors.black, fontSize: 14,
fontSize: 16, ),
), ],
Align( ),
alignment: projectViewModel.isArabic ),
? Alignment.bottomLeft InkWell(
: Alignment.bottomRight, onTap: () {
child: InkWell( widget.goToMyProfile();
onTap: () {}, },
child: Container( child: Container(
margin: EdgeInsets.all(2), margin: EdgeInsets.all(2),
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#D81A2E'), color: Hexcolor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, width: 0.5), color: Colors.transparent,
borderRadius: width: 0.5),
BorderRadius.all(Radius.circular(9)), borderRadius: BorderRadius.all(
), Radius.circular(5),
child: Center( ),
child: Texts( ),
TranslationBase.of(context).viewMore, child: Center(
color: Colors.white, child: Texts(
fontSize: 12, TranslationBase.of(context)
.viewMore,
color: Colors.white,
fontSize: 12,
),
),
),
)
],
), ),
), Row(
//crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Image.asset(
'assets/images/height_icon.png',
width: 35,
height: 40,
),
Texts(
"${model.heightCm}",
color: Colors.white,
)
],
),
),
SizedBox(
width: 3,
),
Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Image.asset(
'assets/images/weight_icon.png',
width: 25,
height: 40,
),
Texts(
'${model.weightKg}',
color: Colors.white,
)
],
),
),
SizedBox(
width: 3,
),
Expanded(
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Image.asset(
'assets/images/blood_icon.png',
width: 35,
height: 40,
),
Texts(
'${model.bloadType}',
color: Colors.white,
)
],
),
),
],
)
],
), ),
), ),
) ),
],
),
),
), ),
), ],
], ),
), Container(
Container( margin: EdgeInsets.only(left: 15, right: 15),
margin: EdgeInsets.only(left: 15, right: 15), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
children: <Widget>[ DashboardItem(
DashboardItem( child: Center(
child: Center( child: Padding(
child: Padding( padding: const EdgeInsets.all(15.0),
padding: const EdgeInsets.all(15.0), child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Image.asset(
Image.asset( 'assets/images/Dr_Schedule_report.png',
'assets/images/Dr_Schedule_report.png', width: 50,
width: 50, height: 50,
height: 50, ),
), SizedBox(
SizedBox( height: 15,
height: 15, ),
), Texts(
Texts( TranslationBase.of(context)
TranslationBase.of(context) .homeHealthCareService,
.homeHealthCareService, textAlign: TextAlign.center,
textAlign: TextAlign.center, color: Colors.white,
color: Colors.white, bold: true,
bold: true, fontSize: 14,
fontSize: 14, )
) ],
], ),
), ),
), ),
height: 150,
imageName: 'home_healthcare_service_bg.png',
opacity: 0.5,
), ),
height: 150, DashboardItem(
imageName: 'home_healthcare_service_bg.png', child: Center(
opacity: 0.5, child: Padding(
), padding: const EdgeInsets.all(15.0),
DashboardItem( child: Column(
child: Center( children: <Widget>[
child: Padding( Image.asset(
padding: const EdgeInsets.all(15.0), 'assets/images/pharmacy_logo.png',
child: Column( width: 40,
children: <Widget>[ height: 40,
Image.asset( ),
'assets/images/new-design/pharmacy_icon.png', SizedBox(
width: 40, height: 15,
height: 40, ),
), Texts(
SizedBox( TranslationBase.of(context).onlinePharmacy,
height: 15, textAlign: TextAlign.center,
), color: Colors.white,
Texts( bold: true,
TranslationBase.of(context).onlinePharmacy, )
textAlign: TextAlign.center, ],
color: Colors.white, ),
bold: true,
)
],
), ),
), ),
height: 150,
imageName: 'al-habib_onlne_pharmacy_bg.png',
), ),
height: 150, DashboardItem(
imageName: 'al-habib_onlne_pharmacy_bg.png', child: Center(
), child: Padding(
DashboardItem( padding: const EdgeInsets.all(15.0),
child: Center( child: Column(
child: Padding( children: <Widget>[
padding: const EdgeInsets.all(15.0), Image.asset(
child: Column( 'assets/images/comprehensive_medical_checkup_logo.png',
children: <Widget>[ width: 50,
Image.asset( height: 50,
'assets/images/Dr_Schedule_report.png', ),
width: 50, SizedBox(
height: 50, height: 15,
), ),
SizedBox( Texts(
height: 15, TranslationBase.of(context).emergencyService,
), textAlign: TextAlign.center,
Texts( color: Colors.white,
TranslationBase.of(context).emergencyService, bold: true,
textAlign: TextAlign.center, fontSize: 14,
color: Colors.white, )
bold: true, ],
fontSize: 14, ),
)
],
), ),
), ),
height: 150,
color: Hexcolor("#747C80"),
imageName: 'emergency_service_image.png',
), ),
height: 150, ],
color: Hexcolor("#747C80"), ),
imageName: 'emergency_service_image.png',
),
],
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), Container(
Container( margin: EdgeInsets.only(left: 15, right: 15),
margin: EdgeInsets.only(left: 15, right: 15), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[
children: <Widget>[ Container(
Container( width: MediaQuery.of(context).size.width * 0.29,
width: MediaQuery.of(context).size.width * 0.29, child: Center(
child: Center( child: Padding(
child: Padding( padding: const EdgeInsets.all(15.0),
padding: const EdgeInsets.all(15.0), child: Column(
child: Column( children: <Widget>[
children: <Widget>[ Image.asset(
Image.asset( 'assets/images/al-habib_online_payment_service_icon.png',
'assets/images/new-design/online_payment_icon.png', height: 55,
width: 80, ),
height: 50, SizedBox(
), height: 15,
SizedBox( ),
height: 15, Texts(
), TranslationBase.of(context)
Texts( .onlinePaymentService,
TranslationBase.of(context) textAlign: TextAlign.center,
.onlinePaymentService, color: Colors.black87,
textAlign: TextAlign.center, bold: false,
color: Colors.black87, fontSize: SizeConfig.textMultiplier * 2,
bold: false, )
fontSize: SizeConfig.textMultiplier * 2, ],
) ),
],
), ),
), ),
height: 150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Colors.white,
),
), ),
height: 150, Container(
decoration: BoxDecoration( child: Center(
borderRadius: BorderRadius.circular(6.0), child: Padding(
color: Colors.white, padding: const EdgeInsets.all(15.0),
), child: Column(
), children: <Widget>[
Container( Image.asset(
'assets/images/ereferral_service_icon.png',
width: 50,
height: 55,
),
SizedBox(
height: 15,
),
Texts(
TranslationBase.of(context)
.offersAndPackages,
textAlign: TextAlign.center,
color: Colors.black87,
bold: false,
fontSize: SizeConfig.textMultiplier * 2,
)
],
),
),
),
width: MediaQuery.of(context).size.width * 0.29,
height: 150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Colors.white,
)),
Container(
width: MediaQuery.of(context).size.width * 0.29,
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/offer_icon.png', 'assets/images/Dr_Schedule_report.png',
width: 50, width: 50,
height: 50, height: 50,
), ),
@ -321,146 +525,114 @@ class _HomePageState extends State<HomePage> {
height: 15, height: 15,
), ),
Texts( Texts(
TranslationBase.of(context).offersAndPackages, TranslationBase.of(context).emergencyServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 1.60,
) )
], ],
), ),
), ),
), ),
width: MediaQuery.of(context).size.width * 0.29,
height: 150, height: 150,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
color: Colors.white, color: Colors.white,
)), ),
Container( ),
width: MediaQuery.of(context).size.width * 0.29, ],
child: Center( ),
child: Padding( ),
padding: const EdgeInsets.all(15.0), SizedBox(
height: 8,
),
Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
DashboardItem(
child: Container(
width: double.infinity,
padding: EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Texts(
'assets/images/Dr_Schedule_report.png', TranslationBase.of(context).hMGService,
width: 50, color: Colors.white,
height: 50, fontWeight: FontWeight.normal,
),
SizedBox(
height: 15,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context)
.comprehensiveMedicalCheckup, .viewAllHabibMedicalService,
textAlign: TextAlign.center, color: Colors.white,
color: Colors.black87, fontWeight: FontWeight.normal,
bold: false, fontSize: 10,
fontSize: SizeConfig.textMultiplier * 1.60, ),
Expanded(
child: Container(),
),
Texts(
TranslationBase.of(context).viewMore,
color: Colors.white,
//fontWeight: FontWeight.normal,
) )
], ],
), ),
), ),
height: 100,
imageName: 'hmg_services_bg .png',
opacity: 0.5,
color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push(
context, FadePage(page: AllHabibMedicalService())),
), ),
height: 150, DashboardItem(
decoration: BoxDecoration( child: Container(
borderRadius: BorderRadius.circular(6.0), width: double.infinity,
color: Colors.white, padding: EdgeInsets.all(10),
), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
], children: <Widget>[
), Texts(
), TranslationBase.of(context).contactUs,
SizedBox( color: Colors.white,
height: 8, fontWeight: FontWeight.normal,
), ),
Container( Texts(
margin: EdgeInsets.only(left: 15, right: 15), TranslationBase.of(context).viewAllWaysReachUs,
child: Row( color: Colors.white,
mainAxisAlignment: MainAxisAlignment.spaceBetween, fontWeight: FontWeight.normal,
children: <Widget>[ fontSize: 10,
DashboardItem( ),
child: Container( Expanded(
width: double.infinity, child: Container(),
padding: EdgeInsets.all(10), ),
child: Column( Texts(
crossAxisAlignment: CrossAxisAlignment.start, TranslationBase.of(context).viewMore,
children: <Widget>[ color: Colors.white,
Texts( fontWeight: FontWeight.normal,
TranslationBase.of(context).hMGService, )
color: Colors.white, ],
fontWeight: FontWeight.normal, ),
),
Texts(
TranslationBase.of(context)
.viewAllHabibMedicalService,
color: Colors.white,
fontWeight: FontWeight.normal,
fontSize: 10,
),
Expanded(
child: Container(),
),
Texts(
TranslationBase.of(context).viewMore,
color: Colors.white,
//fontWeight: FontWeight.normal,
)
],
),
),
height: 100,
imageName: 'hmg_services_bg .png',
opacity: 0.5,
color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push(
context, FadePage(page: AllHabibMedicalService())),
),
DashboardItem(
child: Container(
width: double.infinity,
padding: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
TranslationBase.of(context).contactUs,
color: Colors.white,
fontWeight: FontWeight.normal,
),
Texts(
TranslationBase.of(context).viewAllWaysReachUs,
color: Colors.white,
fontWeight: FontWeight.normal,
fontSize: 10,
),
Expanded(
child: Container(),
),
Texts(
TranslationBase.of(context).viewMore,
color: Colors.white,
fontWeight: FontWeight.normal,
)
],
), ),
height: 100,
imageName: 'contact_us_bg.png',
opacity: 0.5,
color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45,
), ),
height: 100, ],
imageName: 'contact_us_bg.png', ),
opacity: 0.5,
color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45,
),
],
), ),
), SizedBox(
SizedBox( height: 80,
height: 80, )
) ],
], ),
), ),
), ),
), ),

@ -229,14 +229,16 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
children: [ children: [
HomePage(), HomePage(goToMyProfile: (){
_changeCurrentTab(1);
},),
MedicalProfilePage(), MedicalProfilePage(),
MyAdmissionsPage(), MyAdmissionsPage(),
ToDo(), ToDo(),
BookingOptions() BookingOptions()
], // Please do not remove the BookingOptions from this array ], // Please do not remove the BookingOptions from this array
), ),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,),
); );
} }

@ -142,7 +142,7 @@ class AuthProvider with ChangeNotifier {
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; //throw error;
} }
} }

@ -430,6 +430,7 @@ class TranslationBase {
String get gate =>localizedValues['gate'][locale.languageCode]; String get gate =>localizedValues['gate'][locale.languageCode];
String get building =>localizedValues['building'][locale.languageCode]; String get building =>localizedValues['building'][locale.languageCode];
String get branch =>localizedValues['branch'][locale.languageCode]; String get branch =>localizedValues['branch'][locale.languageCode];
String get emergencyServices =>localizedValues['emergencyServices'][locale.languageCode];

@ -9,8 +9,8 @@ import 'bottom_navigation_item.dart';
class BottomNavBar extends StatefulWidget { class BottomNavBar extends StatefulWidget {
final ValueChanged<int> changeIndex; final ValueChanged<int> changeIndex;
final int index ;
BottomNavBar({Key key, this.changeIndex}) : super(key: key); BottomNavBar({Key key, this.changeIndex,this.index}) : super(key: key);
@override @override
_BottomNavBarState createState() => _BottomNavBarState(); _BottomNavBarState createState() => _BottomNavBarState();
@ -21,15 +21,6 @@ class _BottomNavBarState extends State<BottomNavBar> {
_changeIndex(int index) { _changeIndex(int index) {
widget.changeIndex(index); widget.changeIndex(index);
setState(() {
_index = index;
// Navigate to Appointment Booking Flow
// if (_index == 4) navigateToBookingOptions(context);
// Navigate to upcoming list
//if (_index == 3) navigateToToDoList(context);
});
} }
@override @override
@ -48,7 +39,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: EvaIcons.home, icon: EvaIcons.home,
activeIcon: EvaIcons.home, activeIcon: EvaIcons.home,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 0, currentIndex: 0,
name: TranslationBase.of(context).home, name: TranslationBase.of(context).home,
), ),
@ -56,7 +47,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: EvaIcons.list, icon: EvaIcons.list,
activeIcon: EvaIcons.list, activeIcon: EvaIcons.list,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 1, currentIndex: 1,
name: TranslationBase.of(context).medicalProfile, name: TranslationBase.of(context).medicalProfile,
), ),
@ -87,7 +78,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: EvaIcons.person, icon: EvaIcons.person,
activeIcon: EvaIcons.person, activeIcon: EvaIcons.person,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 2, currentIndex: 2,
name: TranslationBase.of(context).mySchedule, name: TranslationBase.of(context).mySchedule,
), ),
@ -95,7 +86,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 3, currentIndex: 3,
name: TranslationBase.of(context).todoList, name: TranslationBase.of(context).todoList,
) )

Loading…
Cancel
Save