# Conflicts:
#	lib/config/config.dart
#	lib/config/localized_values.dart
#	lib/util/translations_delegate_base.dart
merge-requests/138/head
Sultan Khan 4 years ago
commit dd3154a498

@ -3,12 +3,15 @@ import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers();
//ProjectProvider projectsProvider = new ProjectProvider();
/*
*@author: Mohammad Aljammal
@ -38,6 +41,7 @@ class BaseAppClient {
String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
body['ProjectID'] = doctorProfile?.projectID;
@ -45,7 +49,13 @@ class BaseAppClient {
body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';
body['LanguageID'] = LANGUAGE_ID;
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
body['stamp'] = STAMP;
body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID;

@ -32,6 +32,9 @@ const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult';
const GET_LIVECARE_PENDINGLIST =
'Services/DoctorApplication.svc/REST/GetPendingPatientER';
const START_LIVECARE_CALL = 'LiveCareApi/DoctorApp/CallPatient';
const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL =
"Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************
@ -62,6 +65,15 @@ var SERVICES_PATIANT_HEADER = [
"Tomorrow",
"Referral"
];
var SERVICES_PATIANT_HEADER_AR = [
"المريض الخارجي",
"المريض المنوم",
"المريض المعافى",
"المريض المحول الي",
"المريض المحال المعافى",
"مريض الغد",
"المريض المحول مني"
];
//******************
// Colors ////// by : ibrahim

@ -211,5 +211,7 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'You don\'t have any Orders',
'ar': 'لا يوجد لديك اي طلبات'
},
'livecare': {'en': 'Live Care', 'ar': 'Live Care'}
'livecare': {'en': 'Live Care', 'ar': 'Live Care'},
'beingBad': {'en': 'being bad', 'ar': 'سيء'},
'beingGreat': {'en': 'being great', 'ar': 'راثع'},
};

@ -0,0 +1,36 @@
class StatsticsForCertainDoctorRequest {
bool outSA;
int doctorID;
String tokenID;
int channel;
int projectID;
String generalid;
StatsticsForCertainDoctorRequest(
{this.outSA,
this.doctorID,
this.tokenID,
this.channel,
this.projectID,
this.generalid});
StatsticsForCertainDoctorRequest.fromJson(Map<String, dynamic> json) {
outSA = json['OutSA'];
doctorID = json['DoctorID'];
tokenID = json['TokenID'];
channel = json['Channel'];
projectID = json['ProjectID'];
generalid = json['generalid'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['OutSA'] = this.outSA;
data['DoctorID'] = this.doctorID;
data['TokenID'] = this.tokenID;
data['Channel'] = this.channel;
data['ProjectID'] = this.projectID;
data['generalid'] = this.generalid;
return data;
}
}

@ -0,0 +1,68 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/doctor/statstics_for_certain_doctor_request.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
Helpers helpers = Helpers();
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
StatsticsForCertainDoctorRequest _statsticsForCertainDoctorRequest = StatsticsForCertainDoctorRequest();
var certainDoctorsStasticsList = [];
/*@author: ibrahem albitar
*@Date:22/6/2020
*@desc: Doctor Provider
*/
class DoctorsProvider with ChangeNotifier {
bool isLoading = false;
bool isError = false;
String error = '';
resetDefaultValues() {
isLoading = true;
isError = false;
error = '';
notifyListeners();
}
/*@author: ibrahem albitar
*@Date:22/6/2020
*@desc: StatsticsForCertainDoctor
*/
getStatsticsForCertainDoctor(String generalId) async {
resetDefaultValues();
try {
_statsticsForCertainDoctorRequest.generalid = generalId;
await BaseAppClient.post(LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL,
onSuccess: (dynamic response, int statusCode) {
certainDoctorsStasticsList = response['List_LiveCareCertainDoctorsStastics'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _statsticsForCertainDoctorRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
handelCatchErrorCase(err) {
isLoading = false;
isError = true;
error = helpers.generateContactAdminMsg(err);
notifyListeners();
throw err;
}
}

@ -6,7 +6,7 @@ class HospitalProvider with ChangeNotifier {
Future<Map> getProjectsList() async {
const url = GET_PROJECTS;
var info = {
"LanguageID": 2,
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
@ -15,17 +15,13 @@ class HospitalProvider with ChangeNotifier {
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes ;
dynamic localRes;
await BaseAppClient.post(url,
onSuccess: ( response, statusCode) async {
localRes= response;
},
onFailure: (String error, int statusCode) {
throw error;
},
body: info);
await BaseAppClient.post(url, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: info);
return Future.value(localRes);
}
}

@ -22,6 +22,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
LiveCareProvider _liveCareProvider;
bool _isInit = true;
var patientData = {};
String image_url = 'https://hmgwebservices.com/Images/MobileImages/DUBAI/';
//bool _isOutOfStuck = false;
Helpers helpers = new Helpers();
@override
@ -130,7 +131,9 @@ class _VideoCallPageState extends State<VideoCallPage> {
ClipRRect(
borderRadius: BorderRadius.circular(200.0),
child: Image.network(
'https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png',
patientData["Gender"] == "1"
? image_url + 'unkown.png'
: image_url + 'unkowwn_female.png',
height: 200.0,
width: 200.0,
),

@ -60,6 +60,10 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
hintText: TranslationBase.of(context).searchMedicineNameHere,
controller: myController,
onSaved: (value) {},
onFieldSubmitted: (value){
searchMedicine(context);
},
textInputAction: TextInputAction.search,
inputFormatter: ONLY_LETTERS),
),
Container(

@ -3,6 +3,7 @@ import 'dart:typed_data';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -34,6 +35,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
var _data;
Helpers helpers = new Helpers();
MedicineProvider _medicineProvider;
ProjectProvider projectsProvider;
bool _isInit = true;
//bool _isOutOfStuck = false;
@ -50,6 +52,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
@override
Widget build(BuildContext context) {
projectsProvider = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).pharmaciesList,
body: Container(
@ -139,18 +142,23 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
);
})),
Container(
margin: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 2,
bottom: SizeConfig.widthMultiplier * 2,
right: SizeConfig.widthMultiplier * 4,
left: SizeConfig.widthMultiplier * 4,
margin: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 2,
bottom: SizeConfig.widthMultiplier * 2,
right: SizeConfig.widthMultiplier * 4,
left: SizeConfig.widthMultiplier * 4,
),
child: Align(
alignment: Alignment.centerLeft,
child: AppText(
TranslationBase.of(context).youCanFindItIn,
fontWeight: FontWeight.bold,
),
child: Align(
alignment: Alignment.centerLeft,
child: AppText(
TranslationBase.of(context).youCanFindItIn,
fontWeight: FontWeight.bold,
))),
),
alignment: projectsProvider.isArabic
? Alignment.topRight
: Alignment.topLeft,
),
Expanded(
child: Container(
width: SizeConfig.screenWidth * 0.99,

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart';
@ -53,7 +54,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
final String assetName = 'assets/image.svg';
// List<String> _locations = ['Today', 'Old Date', 'YESTERDAY'];
List<String> _locations = ['All', 'Today', 'Tomorrow', 'Next Week'];
List<String> _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0;
bool _isInit = true;
@ -63,6 +65,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isError = true;
String error = "";
ProjectProvider projectsProvider;
final _controller = TextEditingController();
@ -71,12 +74,18 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override
void didChangeDependencies() {
projectsProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patientSearchForm'];
patientType = routeArgs['selectedType'];
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
if (!projectsProvider.isArabic)
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
else
patientTypetitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
print(patientType);
@ -296,6 +305,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
*/
@override
Widget build(BuildContext context) {
_locations = [
TranslationBase.of(context).all,
TranslationBase.of(context).today,
TranslationBase.of(context).tomorrow,
TranslationBase.of(context).nextWeek,
];
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
return AppScaffold(
@ -539,7 +554,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
],
)
: AppText(
item.nationalityName,
item.nationalityName ??
item.nationalityNameN,
fontSize:
2.5 *
SizeConfig.textMultiplier,

@ -61,7 +61,9 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
patientTypeID: patient.patientType,
languageID: 2);
patientsProv
.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson());
.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){
approvalsList = patientsProv.insuranceApporvalsList;
});
}
@override
@ -97,6 +99,7 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
onChanged: (String str) {
this.searchData(str);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(
context,
TranslationBase.of(context)

@ -59,7 +59,9 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
patientsProv.getPatientProgressNote(progressNoteRequest.toJson());
patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = patientsProv.patientProgressNoteList;
});
}
@override
@ -94,6 +96,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
onChanged: (String str) {
this.searchData(str);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
TranslationBase.of(context).searchOrders),
),

@ -59,7 +59,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
tokenID: token,
patientTypeID: patient.patientType,
languageID: 2);
patientsProv.getPatientProgressNote(progressNoteRequest.toJson());
patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = patientsProv.patientProgressNoteList;
});
}
@override
@ -94,6 +96,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
onChanged: (String str) {
this.searchData(str);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
TranslationBase.of(context).searchNote),
),

@ -78,8 +78,8 @@ class _ProfileScreenState extends State<ProfileScreen> {
Icons.crop_square,
color: Colors.black,
subTitle: doctorProfile.doctorRate == 0
? "being bad"
: "being great",
? TranslationBase.of(context).beingBad
: TranslationBase.of(context).beingGreat,
),
],
),

@ -231,6 +231,8 @@ class TranslationBase {
String get errorNoOrders =>
localizedValues['errorNoOrders'][locale.languageCode];
String get livecare => localizedValues['livecare'][locale.languageCode];
String get beingBad => localizedValues['beingBad'][locale.languageCode];
String get beingGreat => localizedValues['beingGreat'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -19,7 +19,9 @@ class AppTextFormField extends FormField<String> {
bool autovalidate = true,
TextInputType textInputType,
String hintText,
FocusNode focusNode
FocusNode focusNode,
TextInputAction textInputAction,
ValueChanged<String> onFieldSubmitted,
}) : super(
onSaved: onSaved,
validator: validator,
@ -34,6 +36,8 @@ class AppTextFormField extends FormField<String> {
onChanged: onChanged?? (value){
state.didChange(value);
},
textInputAction: textInputAction,
onFieldSubmitted: onFieldSubmitted,
decoration: InputDecoration(
hintText: hintText,
hintStyle: TextStyle(fontSize: SizeConfig.textMultiplier * 2),

Loading…
Cancel
Save