Merge branch 'Haroon' into 'master'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!139
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 4b435199fc

@ -1155,4 +1155,13 @@ const Map localizedValues = {
"en": "The request was successful. You have added a child to the vaccination schedule subscription service.",
"ar": "تمت الاضافة بنجاح."
},
"appUpdate": {
"en": "UPDATE THE APP",
"ar": "تحديث التطبيق"
},
"ereferralSaveSuccess": {
"en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ",
"ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة"
},
};

@ -0,0 +1,76 @@
class GetAllProjectsResponseModel {
String desciption;
Null desciptionN;
int iD;
String legalName;
String legalNameN;
String name;
Null nameN;
String phoneNumber;
String setupID;
int distanceInKilometers;
bool isActive;
String latitude;
String longitude;
int mainProjectID;
Null projectOutSA;
bool usingInDoctorApp;
GetAllProjectsResponseModel(
{this.desciption,
this.desciptionN,
this.iD,
this.legalName,
this.legalNameN,
this.name,
this.nameN,
this.phoneNumber,
this.setupID,
this.distanceInKilometers,
this.isActive,
this.latitude,
this.longitude,
this.mainProjectID,
this.projectOutSA,
this.usingInDoctorApp});
GetAllProjectsResponseModel.fromJson(Map<String, dynamic> json) {
desciption = json['Desciption'];
desciptionN = json['DesciptionN'];
iD = json['ID'];
legalName = json['LegalName'];
legalNameN = json['LegalNameN'];
name = json['Name'];
nameN = json['NameN'];
phoneNumber = json['PhoneNumber'];
setupID = json['SetupID'];
distanceInKilometers = json['DistanceInKilometers'];
isActive = json['IsActive'];
latitude = json['Latitude'];
longitude = json['Longitude'];
mainProjectID = json['MainProjectID'];
projectOutSA = json['ProjectOutSA'];
usingInDoctorApp = json['UsingInDoctorApp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Desciption'] = this.desciption;
data['DesciptionN'] = this.desciptionN;
data['ID'] = this.iD;
data['LegalName'] = this.legalName;
data['LegalNameN'] = this.legalNameN;
data['Name'] = this.name;
data['NameN'] = this.nameN;
data['PhoneNumber'] = this.phoneNumber;
data['SetupID'] = this.setupID;
data['DistanceInKilometers'] = this.distanceInKilometers;
data['IsActive'] = this.isActive;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['MainProjectID'] = this.mainProjectID;
data['ProjectOutSA'] = this.projectOutSA;
data['UsingInDoctorApp'] = this.usingInDoctorApp;
return data;
}
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
@ -14,6 +15,9 @@ class EReferralService extends BaseService {
List<GetAllCitiesResponseModel> _allCities = List();
List<GetAllCitiesResponseModel> get allCities => _allCities;
List<GetAllProjectsResponseModel> _allProjects = List();
List<GetAllProjectsResponseModel> get allProjects => _allProjects;
List<SearchEReferralResponseModel> _allReferral = List();
List<SearchEReferralResponseModel> get allReferral => _allReferral;
String _activationCode;
@ -53,6 +57,20 @@ class EReferralService extends BaseService {
}, body: {});
}
Future getAllProjects() async {
await baseAppClient.post(GET_PROJECT,
onSuccess: (dynamic response, int statusCode) {
_allProjects.clear();
response['ListProject'].forEach((city) {
_allProjects
.add(GetAllProjectsResponseModel.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {});
}
Future sendActivationCodeForEReferral(
SendActivationCodeForEReferralRequestModel
@ -60,6 +78,7 @@ class EReferralService extends BaseService {
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL,
onSuccess: (dynamic response, int statusCode) {
print(response["VerificationCode"]);
_activationCode = response["VerificationCode"];
_logInTokenID = response["LogInTokenID"];
@ -86,19 +105,20 @@ class EReferralService extends BaseService {
}, body: checkActivationCodeForEReferralRequestModel.toJson());
}
Future createEReferral(
Future<dynamic> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel
) async {
hasError = false;
dynamic localRes;
await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/,
onSuccess: (dynamic response, int statusCode) {
// TODO Waiting for fix service
var asd= ("EEEEEE");
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: createEReferralRequestModel.toJson());
return Future.value(localRes);
}
Future getEReferrals(

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
@ -31,19 +33,19 @@ class BaseAppClient {
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isExternal = false}) async {
bool isAllowAny = false,
bool isExternal = false}) async {
String url;
if(isExternal) {
if (isExternal) {
url = endPoint;
}else{
} else {
url = BASE_URL + endPoint;
}
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getString(APP_LANGUAGE);
var languageID = await sharedPref.getString(APP_LANGUAGE);
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
@ -60,9 +62,9 @@ class BaseAppClient {
: languageID == 'ar'
? 1
: 2
: languageID == 'ar'
? 1
: 2;
: languageID == 'en'
? 2
: 1;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
@ -95,14 +97,15 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
:user['PatientType'] != null
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] =
body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
}
@ -129,6 +132,10 @@ class BaseAppClient {
if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
}
if (isAllowAny) {
onSuccess(parsed, statusCode);
} else if (parsed['IsAuthenticated'] == null) {
@ -170,6 +177,13 @@ class BaseAppClient {
}
}
Future navigateToAppUpdate(context, String text) async {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => AppUpdatePage(appUpdateText: text)));
}
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
@ -177,7 +191,7 @@ class BaseAppClient {
bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
url = endPoint;
} else {
url = BASE_URL + endPoint;
}
@ -194,7 +208,8 @@ class BaseAppClient {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},);
},
);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
@ -212,9 +227,10 @@ class BaseAppClient {
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
_vitalSignService.weightKg ="";
_vitalSignService.heightCm="";
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
@ -18,64 +19,92 @@ class EReferralViewModel extends BaseViewModel {
List<GetAllRelationshipTypeResponseModel> get relationTypes =>
_eReferralService.relationTypes;
List<GetAllCitiesResponseModel> get allCities => _eReferralService.allCities;
List<SearchEReferralResponseModel> get allReferral => _eReferralService.allReferral;
List<GetAllProjectsResponseModel> get allHospitals =>
_eReferralService.allProjects;
List<SearchEReferralResponseModel> get allReferral =>
_eReferralService.allReferral;
void getRelationTypes() async {
void getRelationTypes() async {
setState(ViewState.Busy);
await _eReferralService.getRelationTypes();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
}
void getAllCities() async {
void getAllCities() async {
setState(ViewState.Busy);
await _eReferralService.getAllCities();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else{
} else {
setState(ViewState.Idle);
}
}
void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async {
void getAllProjects() async {
setState(ViewState.Busy);
await _eReferralService.getAllProjects();
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
void sendActivationCodeForEReferral(
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal);
await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
await _eReferralService.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
setState(ViewState.Idle);
}
}
checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async {
checkActivationCodeForEReferral(
CheckActivationCodeForEReferralResponseModel
checkActivationCodeForEReferralRequestModel) async {
setState(ViewState.BusyLocal);
await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
await _eReferralService.checkActivationCodeForEReferral(
checkActivationCodeForEReferralRequestModel);
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else{
} else {
setState(ViewState.Idle);
}
}
void createEReferral(
Future<dynamic> createEReferral(
CreateEReferralRequestModel createEReferralRequestModel) async {
dynamic localRes;
setState(ViewState.BusyLocal);
await _eReferralService.createEReferral(createEReferralRequestModel);
await _eReferralService
.createEReferral(createEReferralRequestModel)
.then((response) {
localRes = response;
});
if (_eReferralService.hasError) {
error = _eReferralService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
return Future.value(localRes);
}
getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async {

@ -63,7 +63,7 @@ class MyApp extends StatelessWidget {
const Locale('ar', ''), // Arabic
const Locale('en', ''), // English
],
//theme: themeNotifier.getTheme(),
// theme: themeNotifier.getTheme(),
theme:ThemeData(
fontFamily:projectProvider.isArabic ? 'Cairo' : 'WorkSans',
primarySwatch: Colors.blue,
@ -76,6 +76,11 @@ class MyApp extends StatelessWidget {
},
),
hintColor: Colors.grey[400],
textTheme: TextTheme(
headline1: TextStyle(
color: Color(0xffB8382C),
),
),
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],

@ -40,34 +40,32 @@ class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NewEReferralStepOnePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepTowPage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
NewEReferralStepThreePage(
changePageViewIndex: changePageViewIndex,
createEReferralRequestModel: createEReferralRequestModel,
),
],
),
),
),

@ -6,28 +6,29 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class NewEReferralStepOnePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
const NewEReferralStepOnePage(
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
: super(key: key);
@override
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
_NewEReferralStepOnePageState createState() =>
_NewEReferralStepOnePageState();
}
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
@ -64,27 +65,25 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
context: context,
barrierDismissible: false,
child: EReferralConfirmSMSDialog(
phoneNumber: _selectedCountry['code']+_mobileTextController.text,
onSucces: (){
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName=_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD;
}
),
phoneNumber: _selectedCountry['code'] + _mobileTextController.text,
onSucces: () {
Navigator.of(context).pop();
widget.changePageViewIndex(1);
widget.createEReferralRequestModel.requesterName =
_nameTextController.text;
widget.createEReferralRequestModel.requesterContactNo =
_selectedCountry['code'].toString().substring(1) +
_mobileTextController.text;
widget.createEReferralRequestModel.requesterRelationship =
_selectedRelation.iD;
}),
).then((value) {
print("dialog dismissed");
print(value);
if (value != null && value) {
}
if (value != null && value) {}
});
}
return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getRelationTypes(),
builder: (_, model, widget) => AppScaffold(
@ -92,7 +91,7 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
margin: EdgeInsets.all(10),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
@ -100,11 +99,10 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 80,
),
Center(
child: Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Referral requester information",
textAlign: TextAlign.center,
),
@ -185,34 +183,30 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
),
),
bottomSheet: Container(
height: MediaQuery
.of(context)
.size
.height * 0.1,
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
padding: EdgeInsets.all(9),
child: SecondaryButton(
textColor: Colors.white,
label: "Next",
onTap: () async {
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
onTap: () async {
SendActivationCodeForEReferralRequestModel
sendActivationCodeForEReferralRequestModel =
SendActivationCodeForEReferralRequestModel(
zipCode: _selectedCountry['code'],
patientMobileNumber: int.parse(
_mobileTextController.text),);
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
patientMobileNumber: int.parse(_mobileTextController.text),
);
await model.sendActivationCodeForEReferral(
sendActivationCodeForEReferralRequestModel);
showSMSDialog();
},
loading: model.state == ViewState.BusyLocal,
disabled:
_nameTextController.text.isEmpty ||
disabled: _nameTextController.text.isEmpty ||
_selectedRelation == null ||
_mobileTextController.text.isEmpty,
),
)));
}
void confirmSelectRelationTypeDialog(
@ -261,12 +255,8 @@ class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
}
class MobileNumberTextFiled extends StatelessWidget {
const MobileNumberTextFiled({
Key key,
this.controller,
this.code
}) : super(key: key);
const MobileNumberTextFiled({Key key, this.controller, this.code})
: super(key: key);
final TextEditingController controller;
final String code;

@ -1,21 +1,23 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_project_dialog.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../dialogs/select_city_dialog.dart';
class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
@ -32,7 +34,8 @@ class NewEReferralStepThreePage extends StatefulWidget {
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
TextEditingController _nameTextController = TextEditingController();
TextEditingController _mobileTextController = TextEditingController();
GetAllCitiesResponseModel _selectedCity;
GetAllProjectsResponseModel _selectedHospital;
GetAllSharedRecordsByStatusList selectedPatientFamily;
List<EReferralAttachment> medicalReportImages = [];
@ -50,6 +53,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
@override
Widget build(BuildContext context) {
return BaseView<EReferralViewModel>(
onModelReady: (model) => model.getAllProjects(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: false,
body: SingleChildScrollView(
@ -64,7 +68,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 80,
),
Center(
child: Texts(
@ -103,8 +107,13 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
ImageOptions.showImageOptions(context,
(String image) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
medicalReportImages.add(eReferralAttachment);
EReferralAttachment eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
medicalReportImages
.add(eReferralAttachment);
});
});
},
@ -158,15 +167,17 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
width: 8,
),
Texts(
medicalReportImages[index].fileName,
medicalReportImages[index]
.fileName,
),
],
),
InkWell(
onTap: () {
setState(() {
medicalReportImages
.remove(medicalReportImages[index]);
medicalReportImages.remove(
medicalReportImages[
index]);
});
},
child: Icon(
@ -205,7 +216,7 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
InkWell(
onTap: () =>
confirmSelectCityDialog(model.allCities),
confirmSelectHospital(model.allHospitals),
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
@ -262,12 +273,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
],
),
),
if(isPatientInsured)
SizedBox(
height: 12,
),
if (isPatientInsured)
SizedBox(
height: 12,
),
Opacity(
opacity: isPatientInsured?1:0,
opacity: isPatientInsured ? 1 : 0,
child: Container(
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
@ -276,16 +287,21 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
child: Column(
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context,
(String image) {
setState(() {
EReferralAttachment
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
insuredPatientImages=[eReferralAttachment];
insuredPatientImages = [
eReferralAttachment
];
});
});
},
@ -333,8 +349,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Icon(
FontAwesomeIcons.paperclip),
Icon(FontAwesomeIcons
.paperclip),
SizedBox(
width: 8,
),
@ -346,8 +362,9 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell(
onTap: () {
setState(() {
insuredPatientImages
.remove(insuredPatientImages[index]);
insuredPatientImages.remove(
insuredPatientImages[
index]);
});
},
child: Icon(
@ -378,50 +395,72 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
textColor: Colors.white,
label: "Submit",
onTap: () async {
this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
this
.widget
.createEReferralRequestModel
.medicalReportAttachment = medicalReportImages;
this
.widget
.createEReferralRequestModel
.insuranceCardAttachment =
insuredPatientImages.length != 0
? insuredPatientImages[0]
: null;
this.widget.createEReferralRequestModel.isInsuredPatient =
isPatientInsured;
// ToDo make the preferred Branch info dynamic
this.widget.createEReferralRequestModel.preferredBranchCode = 15;
this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
this.widget.createEReferralRequestModel.preferredBranchCode =
_selectedHospital.iD;
this.widget.createEReferralRequestModel.preferredBranchName =
_selectedHospital.desciption;
this.widget.createEReferralRequestModel.otherRelationship =
"";
// this.widget.createEReferralRequestModel.fullName= "";
this.widget.createEReferralRequestModel.otherRelationship= "";
// this.widget.createEReferralRequestModel.;
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
await model.createEReferral(this.widget.createEReferralRequestModel);
await model
.createEReferral(this.widget.createEReferralRequestModel)
.then((value) {
AlertDialogBox(
context: context,
confirmMessage:
TranslationBase.of(context).ereferralSaveSuccess +
value['ReferralNumber'].toString(),
okText: TranslationBase.of(context).ok,
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
navigateToHome(context);
}).showAlertDialog(context);
});
},
loading: model.state == ViewState.BusyLocal,
disabled: medicalReportImages.length == 0 ,
disabled: medicalReportImages.length == 0,
),
)));
}
void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
Future navigateToHome(context) async {
Navigator.of(context).popAndPushNamed(HOME);
}
void confirmSelectHospital(List<GetAllProjectsResponseModel> projects) {
showDialog(
context: context,
child: SelectCityDialog(
cities: cities,
selectedCity: _selectedCity,
child: SelectHospitalDialog(
hospitals: projects,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedCity = value;
_selectedHospital = value;
});
},
),
);
}
String getRelationName() {
if (_selectedCity != null)
return _selectedCity.description;
if (_selectedHospital != null)
return _selectedHospital.desciption;
else
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
return "Select Hospital*" /*TranslationBase.of(context).selectHospital*/;
}
}

@ -71,7 +71,7 @@ class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 30,
height: 80,
),
Center(
child: Texts(

@ -0,0 +1,129 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
class SelectHospitalDialog extends StatefulWidget {
final List<GetAllProjectsResponseModel> hospitals;
final Function(GetAllProjectsResponseModel) onValueSelected;
GetAllProjectsResponseModel selectedHospital;
SelectHospitalDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override
_SelectHospitalDialogState createState() => _SelectHospitalDialogState();
}
class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
@override
void initState() {
super.initState();
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
}
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
children: [
Divider(),
...List.generate(
widget.hospitals.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 2,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedHospital = widget.hospitals[index];
});
},
child: ListTile(
title: Text(widget.hospitals[index].desciption),
leading: Radio(
value: widget.hospitals[index],
groupValue: widget.selectedHospital,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
widget.selectedHospital = value;
});
},
),
),
),
)
],
),
SizedBox(
height: 5.0,
),
],
),
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
widget.onValueSelected(widget.selectedHospital);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -88,13 +88,13 @@ class _EReferralPageState extends State<EReferralPage>
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("New Referral"),
child: Texts("New Referral", fontSize: 14.0),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("Search for Referrals"),
child: Texts("Search for Referrals", fontSize: 14.0),
),
),
],

@ -0,0 +1,109 @@
import 'dart:io';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:url_launcher/url_launcher.dart';
class AppUpdatePage extends StatefulWidget {
String appUpdateText;
AppUpdatePage({@required this.appUpdateText});
@override
_AppUpdatePageState createState() => _AppUpdatePageState();
}
class _AppUpdatePageState extends State<AppUpdatePage> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "App Update",
backgroundColor: Colors.white,
isShowAppBar: false,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
child: Column(
children: [
Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
SvgPicture.asset(
"assets/images/new-design/update_rocket_image.svg",
fit: BoxFit.fill),
]),
Container(
margin: EdgeInsets.only(top: 40.0),
width: MediaQuery.of(context).size.width,
child: Text(TranslationBase.of(context).appUpdate,
textAlign: TextAlign.center,
style: TextStyle(
color: Color(0xff2d6c90).withOpacity(1.0),
fontSize: 22.0,
fontWeight: FontWeight.bold))),
],
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: SvgPicture.asset("assets/images/new-design/HMG_logo.svg",
fit: BoxFit.fill),
),
Container(
margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0),
width: MediaQuery.of(context).size.width,
child: Text(widget.appUpdateText,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[600],
fontSize: 16.0,
height: 1.5,
fontWeight: FontWeight.bold))),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: Colors.red[800],
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
openAppUpdateLink();
},
child: Text(TranslationBase.of(context).appUpdate,
style: TextStyle(fontSize: 18.0)),
),
),
),
],
),
),
),
);
}
openAppUpdateLink() {
if (Platform.isAndroid) {
_launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg");
}
if (Platform.isIOS) {
_launchURL("https://itunes.apple.com/app/id733503978");
}
}
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
}

@ -134,8 +134,8 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
position:
BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9)
.withOpacity(1.0),
badgeColor: Colors
.red[800].withOpacity(1.0),
borderRadius:
BorderRadius.circular(8),
badgeContent: Container(

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart';
class HealthDataList extends StatefulWidget {
@ -8,6 +9,19 @@ class HealthDataList extends StatefulWidget {
}
class _HealthDataListState extends State<HealthDataList> {
List<DataType> dataTypes = List();
@override
void initState() {
dataTypes.add(DataType.DISTANCE);
dataTypes.add(DataType.STEP_COUNT);
dataTypes.add(DataType.HEART_RATE);
dataTypes.add(DataType.SLEEP);
dataTypes.add(DataType.ENERGY);
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
@ -132,7 +146,7 @@ class _HealthDataListState extends State<HealthDataList> {
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
onTap: () {
// launch(model.radImageURL);
readAll();
},
label: 'Sync Health Data',
backgroundColor: Colors.grey[800],
@ -142,4 +156,26 @@ class _HealthDataListState extends State<HealthDataList> {
),
));
}
void readLast() async {
final result = await FitKit.readLast(DataType.DISTANCE);
print(result);
print(result);
}
void readAll() async {
if (await FitKit.requestPermissions(dataTypes)) {
for (DataType type in dataTypes) {
final results = await FitKit.read(
type,
dateFrom: DateTime.now().subtract(Duration(days: 15)),
dateTo: DateTime.now(),
limit: 100,
);
print(results);
print(results.length);
}
readLast();
}
}
}

@ -31,6 +31,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
return AppScaffold(
appBarTitle: "Sync Health Data",
isShowAppBar: true,
isShowDecPage: false,
body: Container(
child: Platform.isIOS
? _getAppleWatchInstructions()
@ -88,6 +89,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 1",
style: TextStyle(
@ -108,8 +111,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 2",
overflow: TextOverflow.clip,
softWrap: true,
style: TextStyle(
fontSize: 12.0)),
)
@ -135,6 +142,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 3",
style: TextStyle(
@ -155,6 +164,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 4",
style: TextStyle(
@ -182,6 +193,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 5",
style: TextStyle(
@ -202,6 +215,8 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: 70.0,
height: 70.0),
Container(
margin: EdgeInsets.only(left: 5.0),
width: 105.0,
child: Text(
"Apple Watch Series 6",
style: TextStyle(
@ -427,7 +442,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 5.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 0.0),
color: Colors.white.withOpacity(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
@ -657,7 +672,7 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
style: TextStyle(fontSize: 17.0)),
),
Container(
margin: EdgeInsets.all(15.0),
margin: EdgeInsets.all(12.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius:

@ -46,7 +46,7 @@ class VitalSignItem extends StatelessWidget {
des,
style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier,
color: HexColor('#B8382C'),
color: Theme.of(context).textTheme.headline1.color,
fontWeight: FontWeight.bold,
),
),
@ -76,11 +76,11 @@ class VitalSignItem extends StatelessWidget {
text: TextSpan(
style: TextStyle(color: Colors.black),
children: [
TextSpan(text: lastVal),
TextSpan(text: lastVal + " "),
TextSpan(
text: unit,
style: TextStyle(
color: HexColor('#B8382C'),
color: Theme.of(context).textTheme.headline1.color,
),
),
]),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family-member.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family_type.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
@ -35,6 +36,7 @@ const String SYMPTOM_CHECKER = 'symptom-checker';
const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info';
const String SELECT_GENDER = 'select-gender';
const String SETTINGS = 'settings';
const String APP_UPDATE = 'app_update';
var routes = {
SPLASH: (_) => SplashScreen(),
HOME: (_) => LandingPage(),
@ -52,5 +54,6 @@ var routes = {
SYMPTOM_CHECKER: (_) => SymptomChecker(),
SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(),
SELECT_GENDER: (_) => SelectGender(),
SETTINGS: (_) => Settings()
SETTINGS: (_) => Settings(),
APP_UPDATE: (_) => AppUpdatePage()
};

@ -65,6 +65,7 @@ final blueBackground = Color(0xFFFFFFFF);
},
),
hintColor: Colors.grey[400],
accentColor: Color(0xffB8382C),
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor: Color(0xffEEEEEE),

@ -896,6 +896,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get deletedChild => localizedValues['deleted-child'][locale.languageCode];
String get addInstructions => localizedValues['add-instructions'][locale.languageCode];
String get addedChild => localizedValues['added-child'][locale.languageCode];
String get appUpdate => localizedValues['appUpdate'][locale.languageCode];
String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode];
}

@ -80,7 +80,8 @@ class BottomNavigationItem extends StatelessWidget {
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9).withOpacity(1.0),
badgeColor: Colors
.red[800].withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),

@ -15,7 +15,7 @@ class ImageOptions {
return _BottomSheet(
children: <Widget>[
_BottomSheetItem(
title: "Select file souse",
title: "Select file source",
),
_BottomSheetItem(
title: "Gallery",

Loading…
Cancel
Save