blood type update for family files

merge-requests/215/head
Sultan Khan 4 years ago
parent 37ab778fd0
commit d53031b0e6

@ -16,7 +16,6 @@ class DashboardViewModel extends BaseViewModel {
// Provider.of<ToDoCountProviderModel>(AppGlobal.context); // Provider.of<ToDoCountProviderModel>(AppGlobal.context);
getPatientRadOrders() async { getPatientRadOrders() async {
booldType = await sharedPref.getString(BLOOD_TYPE);
if (isLogin && _vitalSignService.weightKg.isEmpty) { if (isLogin && _vitalSignService.weightKg.isEmpty) {
setState(ViewState.Busy); setState(ViewState.Busy);
await _vitalSignService.getPatientRadOrders(); await _vitalSignService.getPatientRadOrders();
@ -25,7 +24,7 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
bloadType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-";
} }
} }

@ -709,19 +709,21 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
result = list.CheckActivationCode.fromJson(result); result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
var mainUser = await sharedPref.getObject(MAIN_USER); var mainUser = await sharedPref.getObject(MAIN_USER);
var bloodType = await sharedPref.getString(BLOOD_TYPE);
this.sharedPref.clear(); this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) { if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true; result.list.isFamily = true;
} }
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);
//sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']); this.sharedPref.setString(BLOOD_TYPE, bloodType);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).setUser( authenticatedUserObject.user); Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
//this.checkIfUserAgreedBefore(result), //this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(

@ -43,7 +43,6 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -54,7 +53,6 @@ class _HomePageState extends State<HomePage> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
@ -82,15 +80,19 @@ class _HomePageState extends State<HomePage> {
left: 5, left: 5,
right: 5, right: 5,
child: Container( child: Container(
width: MediaQuery.of(context).size.width * 0.8, width:
MediaQuery.of(context).size.width * 0.8,
child: Container(), child: Container(),
), ),
) )
], ],
), ),
), ),
Container(width: double.infinity, height:projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.3 :110), Container(
width: double.infinity,
height: projectViewModel.isArabic
? MediaQuery.of(context).size.width * 0.3
: 110),
], ],
), ),
Positioned( Positioned(
@ -174,7 +176,6 @@ class _HomePageState extends State<HomePage> {
color: Theme.of(context) color: Theme.of(context)
.primaryColor, .primaryColor,
fontSize: 14, fontSize: 14,
), ),
), ),
), ),
@ -208,7 +209,8 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
if (projectViewModel.user != null && model.isLogin) if (projectViewModel.user != null &&
model.isLogin)
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -218,9 +220,11 @@ class _HomePageState extends State<HomePage> {
height: 8, height: 8,
), ),
Texts( Texts(
projectViewModel.user.firstName + projectViewModel
.user.firstName +
" " + " " +
projectViewModel.user.lastName, projectViewModel
.user.lastName,
color: Colors.grey[100], color: Colors.grey[100],
bold: true, bold: true,
fontSize: 15, fontSize: 15,
@ -266,7 +270,8 @@ class _HomePageState extends State<HomePage> {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).myMedicalFile, TranslationBase.of(context)
.myMedicalFile,
color: Theme.of(context) color: Theme.of(context)
.primaryColor, .primaryColor,
fontSize: 12, fontSize: 12,
@ -301,7 +306,9 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
TranslationBase.of(context).height, TranslationBase.of(
context)
.height,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
), ),
@ -333,7 +340,9 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
TranslationBase.of(context).weight, TranslationBase.of(
context)
.weight,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -347,8 +356,10 @@ class _HomePageState extends State<HomePage> {
), ),
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center, MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/blood-drop.png', 'assets/images/blood-drop.png',
@ -360,9 +371,14 @@ class _HomePageState extends State<HomePage> {
Texts( Texts(
'${model.booldType}', '${model.booldType}',
color: Colors.white, color: Colors.white,
fontSize: 14,
fontWeight:
FontWeight.bold,
), ),
Texts( Texts(
TranslationBase.of(context).bloodType, TranslationBase.of(
context)
.bloodType,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -401,28 +417,35 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox(height: 15,), SizedBox(
height: 15,
),
Container( Container(
width: 60, width: 60,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(12) borderRadius:
), BorderRadius.circular(12)),
child: Center(child: Image.asset('assets/images/medical/vital_sign_icon.png', child: Center(
child: Image.asset(
'assets/images/medical/vital_sign_icon.png',
width: 80, width: 80,
height: 50, height: 50,
fit: BoxFit.contain,)), fit: BoxFit.contain,
)),
),
SizedBox(
height: 20,
), ),
SizedBox(height: 20,),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).vitalSigns,
.vitalSigns,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, fontSize: projectViewModel.isArabic
? SizeConfig.textMultiplier * 1.5
: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -450,26 +473,35 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox(height: 15,), SizedBox(
height: 15,
),
Container( Container(
width: 50, width: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(12) borderRadius:
), BorderRadius.circular(12)),
child: Center(child: Image.asset('assets/images/search_medicine_icon.png', child: Center(
child: Image.asset(
'assets/images/search_medicine_icon.png',
width: 50, width: 50,
height: 50, height: 50,
fit: BoxFit.contain,)), fit: BoxFit.contain,
)),
),
SizedBox(
height: 20,
), ),
SizedBox(height: 20,),
Texts( Texts(
TranslationBase.of(context).searchMedicine, TranslationBase.of(context).searchMedicine,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, fontSize: projectViewModel.isArabic
? SizeConfig.textMultiplier * 1.5
: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -481,7 +513,8 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
Expanded( Expanded(
child: DashboardItem(opacity: 1.0, child: DashboardItem(
opacity: 1.0,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -495,25 +528,35 @@ class _HomePageState extends State<HomePage> {
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SizedBox(height: 15,), SizedBox(
height: 15,
),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(12) borderRadius:
), BorderRadius.circular(12)),
child: Center(child: Image.asset('assets/images/online_payment_icon.png', child: Center(
child: Image.asset(
'assets/images/online_payment_icon.png',
width: 80, width: 80,
height: 50, height: 50,
fit: BoxFit.contain,)), fit: BoxFit.contain,
)),
),
SizedBox(
height: 15,
), ),
SizedBox(height: 15,),
Texts( Texts(
TranslationBase.of(context).onlinePaymentService, TranslationBase.of(context)
.onlinePaymentService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, fontSize: projectViewModel.isArabic
? SizeConfig.textMultiplier * 1.5
: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -527,7 +570,9 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
// Padding( // Padding(
// padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
// child: LineChartSample1(), // child: LineChartSample1(),
@ -554,34 +599,33 @@ class _HomePageState extends State<HomePage> {
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title:
.myAppointments, TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png', imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList, subTitle: TranslationBase.of(context)
.myAppointmentsList,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () => Navigator.push(
FadePage(page: LabsHomePage())), context, FadePage(page: LabsHomePage())),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).lab, title: TranslationBase.of(context).lab,
imagePath: 'lab_result_icon.png', imagePath: 'lab_result_icon.png',
subTitle: subTitle: TranslationBase.of(context).lab,
TranslationBase.of(context).lab,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () => Navigator.push(
FadePage(page: RadiologyHomePage())), context, FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context).radiology,
.radiology,
imagePath: 'radiology_icon.png', imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.radiologySubtitle, .radiologySubtitle,
@ -604,8 +648,7 @@ class _HomePageState extends State<HomePage> {
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context).medicines,
.medicines,
imagePath: 'prescription_icon.png', imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.medicinesSubtitle, .medicinesSubtitle,
@ -624,8 +667,7 @@ class _HomePageState extends State<HomePage> {
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context).myDoctor,
.myDoctor,
imagePath: 'doctor_icon.png', imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.myDoctorSubtitle, .myDoctorSubtitle,
@ -636,12 +678,11 @@ class _HomePageState extends State<HomePage> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(
FadePage(page: InsuranceCard())); context, FadePage(page: InsuranceCard()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context) title: TranslationBase.of(context).insurance,
.insurance,
imagePath: 'insurance_card_icon.png', imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.insuranceSubtitle, .insuranceSubtitle,
@ -650,7 +691,6 @@ class _HomePageState extends State<HomePage> {
), ),
], ],
), ),
], ],
), ),
), ),
@ -676,7 +716,8 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
TranslationBase.of(context).viewAllHabibMedicalService, TranslationBase.of(context)
.viewAllHabibMedicalService,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 10, fontSize: 10,
@ -697,7 +738,11 @@ class _HomePageState extends State<HomePage> {
//color: Colors.grey[700], //color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, FadePage(page: AllHabibMedicalService(goToMyProfile: widget.goToMyProfile,))), context,
FadePage(
page: AllHabibMedicalService(
goToMyProfile: widget.goToMyProfile,
))),
), ),
DashboardItem( DashboardItem(
opacity: 1.0, opacity: 1.0,

@ -20,7 +20,8 @@ class LocationUtils {
Geolocator.checkPermission().then((permission) { Geolocator.checkPermission().then((permission) {
if (permission == LocationPermission.always || if (permission == LocationPermission.always ||
permission == LocationPermission.whileInUse) { permission == LocationPermission.whileInUse) {
Geolocator.getLastKnownPosition().then((value) => setLocation(value)); Geolocator.getLastKnownPosition()
.then((value) => setLocation(value));
} }
if (permission == LocationPermission.denied || if (permission == LocationPermission.denied ||
@ -57,9 +58,12 @@ class LocationUtils {
} }
void setLocation(Position position) { void setLocation(Position position) {
print(position); this
this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); .sharedPref
this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); .setDouble(USER_LAT, position != null ? position.latitude : 0.0);
this
.sharedPref
.setDouble(USER_LONG, position != null ? position.longitude : 0.0);
} }
void setZeroLocation() { void setZeroLocation() {

@ -567,19 +567,21 @@ class _AppDrawerState extends State<AppDrawer> {
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
var currentLang = await sharedPref.getString(APP_LANGUAGE); var currentLang = await sharedPref.getString(APP_LANGUAGE);
var mainUser = await sharedPref.getObject(MAIN_USER); var mainUser = await sharedPref.getObject(MAIN_USER);
var bloodType = await sharedPref.getString(BLOOD_TYPE);
this.sharedPref.clear(); this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) { if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true; result.list.isFamily = true;
} }
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
// sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']); this.sharedPref.setString(BLOOD_TYPE, bloodType);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).setUser( authenticatedUserObject.user); Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {

Loading…
Cancel
Save