Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into diplomatic-quarter-haroon

# Conflicts:
#	lib/pages/landing/home_page.dart
merge-update-with-lab-changes
haroon amjad 5 years ago
commit ffbc7c4af4

@ -17,8 +17,8 @@ class AuthenticatedUserObject {
if (userData != null) user = AuthenticatedUser.fromJson(userData); if (userData != null) user = AuthenticatedUser.fromJson(userData);
} }
var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID); // var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID);
this.isLogin = isLogin != null; this.isLogin = user != null;
} }
logout() async { logout() async {

@ -13,6 +13,7 @@ class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = List();
Future getPatientLabOrdersList() async { Future getPatientLabOrdersList() async {
hasError = false;
await baseAppClient.post(GET_Patient_LAB_ORDERS, await baseAppClient.post(GET_Patient_LAB_ORDERS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear(); patientLabOrdersList.clear();

@ -30,6 +30,9 @@ class BaseViewModel extends ChangeNotifier {
} }
BaseViewModel() { BaseViewModel() {
//authenticatedUserObject.getUser();
user = authenticatedUserObject.user;
this.isLogin = authenticatedUserObject.isLogin;
_getUser(); _getUser();
} }

@ -10,7 +10,7 @@ class DashboardViewModel extends BaseViewModel {
String bloadType = ""; String bloadType = "";
getPatientRadOrders() async { getPatientRadOrders() async {
if (!isLogin && _vitalSignService.weightKg.isEmpty) { if (isLogin && _vitalSignService.weightKg.isEmpty) {
setState(ViewState.Busy); setState(ViewState.Busy);
await _vitalSignService.getPatientRadOrders(); await _vitalSignService.getPatientRadOrders();
if (_vitalSignService.hasError) { if (_vitalSignService.hasError) {

@ -6,12 +6,14 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
class ConfirmSMSDialog extends StatefulWidget { class ConfirmSMSDialog extends StatefulWidget {
@ -97,6 +99,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
builder: (_, model, w) => Dialog( builder: (_, model, w) => Dialog(
elevation: 0.6, elevation: 0.6,
@ -107,20 +110,18 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
Container( Container(
width: double.infinity, width: double.infinity,
height: 40, height: 40,
color: Colors.grey[700], color: Theme.of(context).primaryColor,
child: Row( child: Stack(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Center(
flex: 4,
child: Center(
child: Texts( child: Texts(
'SMS', 'SMS',
color: Colors.white, color: Colors.white,
textAlign: TextAlign.center, textAlign: TextAlign.center,
))), ),
Expanded( ),
flex: 1, Positioned(child: Container(
child: InkWell( child: InkWell(
onTap: () => Navigator.pop(context), onTap: () => Navigator.pop(context),
child: Container( child: Container(
@ -131,8 +132,12 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
color: Colors.grey[900], color: Colors.grey[900],
)), )),
), ),
),
left: projectViewModel.isArabic? 2:0,
right: projectViewModel.isArabic? 0:2,
) )
], ],
), ),
), ),
Image.asset( Image.asset(

@ -49,9 +49,8 @@ class _HomePageState extends State<HomePage> {
}); });
super.initState(); super.initState();
} }
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -94,10 +93,9 @@ class _HomePageState extends State<HomePage> {
) )
], ],
), ),
), ),
Container( Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110),
width: double.infinity,
height: projectViewModel.isArabic ? 120 : 110),
], ],
), ),
Positioned( Positioned(
@ -112,8 +110,7 @@ class _HomePageState extends State<HomePage> {
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
child: (!authenticatedUserObject.isLogin && child: (!model.isLogin )
projectViewModel.user == null)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 160, height: 160,
@ -309,9 +306,7 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
TranslationBase.of( TranslationBase.of(context).height,
context)
.height,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
), ),
@ -343,9 +338,7 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
TranslationBase.of( TranslationBase.of(context).weight,
context)
.weight,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -359,10 +352,8 @@ class _HomePageState extends State<HomePage> {
), ),
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.start,
MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/blood-drop.png', 'assets/images/blood-drop.png',
@ -376,9 +367,7 @@ class _HomePageState extends State<HomePage> {
color: Colors.white, color: Colors.white,
), ),
Texts( Texts(
TranslationBase.of( TranslationBase.of(context).bloodType,
context)
.bloodType,
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -417,35 +406,28 @@ 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( SizedBox(height: 15,),
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: BorderRadius.circular(12)
BorderRadius.circular(12)), ),
child: Center( child: Center(child: Image.asset('assets/images/vital_sign_icon.png',
child: Image.asset(
'assets/images/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).vitalSigns, TranslationBase.of(context)
.vitalSigns,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: projectViewModel.isArabic fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7,
? SizeConfig.textMultiplier * 1.5
: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -473,35 +455,26 @@ 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( SizedBox(height: 15,),
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: BorderRadius.circular(12)
BorderRadius.circular(12)), ),
child: Center( child: Center(child: Image.asset('assets/images/search_medicine_icon.png',
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 fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7,
? SizeConfig.textMultiplier * 1.5
: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -513,9 +486,8 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
Expanded( Expanded(
child: DashboardItem( child: DashboardItem(opacity: 1.0,
opacity: 1.0, onTap: (){
onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -528,35 +500,25 @@ 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( SizedBox(height: 15,),
height: 15,
),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: borderRadius: BorderRadius.circular(12)
BorderRadius.circular(12)), ),
child: Center( child: Center(child: Image.asset('assets/images/online_payment_icon.png',
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) TranslationBase.of(context).onlinePaymentService,
.onlinePaymentService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: projectViewModel.isArabic fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7,
? SizeConfig.textMultiplier * 1.5
: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -592,33 +554,34 @@ class _HomePageState extends State<HomePage> {
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: title: TranslationBase.of(context)
TranslationBase.of(context).myAppointments, .myAppointments,
imagePath: 'my_appointment_icon.png', imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context).myAppointmentsList,
.myAppointmentsList,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(context,
context, FadePage(page: LabsHomePage())), 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: TranslationBase.of(context).lab, subTitle:
TranslationBase.of(context).lab,
), ),
), ),
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(context,
context, FadePage(page: RadiologyHomePage())), FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context)
.radiology,
imagePath: 'radiology_icon.png', imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.radiologySubtitle, .radiologySubtitle,
@ -641,7 +604,8 @@ class _HomePageState extends State<HomePage> {
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context)
.medicines,
imagePath: 'prescription_icon.png', imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.medicinesSubtitle, .medicinesSubtitle,
@ -660,7 +624,8 @@ class _HomePageState extends State<HomePage> {
); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor, title: TranslationBase.of(context)
.myDoctor,
imagePath: 'doctor_icon.png', imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.myDoctorSubtitle, .myDoctorSubtitle,
@ -671,11 +636,12 @@ class _HomePageState extends State<HomePage> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(context,
context, FadePage(page: InsuranceCard())); FadePage(page: InsuranceCard()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context)
.insurance,
imagePath: 'insurance_card_icon.png', imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context) subTitle: TranslationBase.of(context)
.insuranceSubtitle, .insuranceSubtitle,
@ -684,6 +650,7 @@ class _HomePageState extends State<HomePage> {
), ),
], ],
), ),
], ],
), ),
), ),
@ -696,7 +663,7 @@ class _HomePageState extends State<HomePage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
DashboardItem( DashboardItem(
opacity: 1.0, opacity:1.0,
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -709,8 +676,7 @@ class _HomePageState extends State<HomePage> {
bold: true, bold: true,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).viewAllHabibMedicalService,
.viewAllHabibMedicalService,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 10, fontSize: 10,
@ -731,14 +697,10 @@ 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, context, FadePage(page: AllHabibMedicalService(goToMyProfile: widget.goToMyProfile,))),
FadePage(
page: AllHabibMedicalService(
goToMyProfile: widget.goToMyProfile,
))),
), ),
DashboardItem( DashboardItem(
opacity: 1.0, opacity:1.0,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, FadePage(page: ContactUsPage())); context, FadePage(page: ContactUsPage()));
@ -758,7 +720,7 @@ class _HomePageState extends State<HomePage> {
TranslationBase.of(context).viewAllWaysReachUs, TranslationBase.of(context).viewAllWaysReachUs,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.0, fontSize: SizeConfig.textMultiplier * 1.0 ,
), ),
Expanded( Expanded(
child: Container(), child: Container(),
@ -796,7 +758,6 @@ class _HomePageState extends State<HomePage> {
} }
getToDoCount() { getToDoCount() {
if (authenticatedUserObject.isLogin) {
toDoProvider.setState(0); toDoProvider.setState(0);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
@ -812,7 +773,6 @@ class _HomePageState extends State<HomePage> {
print(err); print(err);
}); });
} }
}
} }
class DashboardItem extends StatelessWidget { class DashboardItem extends StatelessWidget {
@ -825,9 +785,7 @@ class DashboardItem extends StatelessWidget {
this.width, this.width,
this.height, this.height,
this.color, this.color,
this.opacity = 1.0, this.opacity = 1.0,this.icon,this.margin=0})
this.icon,
this.margin = 0})
: super(key: key); : super(key: key);
final bool hasBorder; final bool hasBorder;
final String imageName; final String imageName;

@ -217,12 +217,13 @@ class _Login extends State<Login> {
// request.isRegister = false; // request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) => { this.authService.checkActivationCode(request, code).then((result) => {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result),
authenticatedUserObject.getUser(),
this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(USER_PROFILE, result.list),
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),
authenticatedUserObject.getUser(),
// authenticatedUserObject.user = AuthenticatedUser.fromJson(result.list),
authenticatedUserObject.isLogin = true, authenticatedUserObject.isLogin = true,
appointmentRateViewModel.isLogin =true, appointmentRateViewModel.isLogin = true,
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {

@ -2,6 +2,9 @@ import 'dart:async';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'core/service/AuthenticatedUserObject.dart';
import 'locator.dart';
class SplashScreen extends StatefulWidget { class SplashScreen extends StatefulWidget {
@override @override
_SplashScreenState createState() => _SplashScreenState(); _SplashScreenState createState() => _SplashScreenState();

@ -101,8 +101,6 @@ class AppScaffold extends StatelessWidget {
icon: Icon(FontAwesomeIcons.home), icon: Icon(FontAwesomeIcons.home),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
MaterialPageRoute(builder: (context) => LandingPage()), MaterialPageRoute(builder: (context) => LandingPage()),

Loading…
Cancel
Save