Health Calculators APIs updated

merge-requests/464/head
haroon amjad 4 years ago
parent b7bf99c862
commit 73822300f9

@ -1605,4 +1605,6 @@ const Map localizedValues = {
"android-instructions-4": { "en": "Make sure that your smart watch apps are linked/associated with Google Fit App.", "ar": "تأكد من أن تطبيقات ساعتك الذكية مرتبطة / مرتبطة بتطبيق Google Fit." }, "android-instructions-5": { "en": "Make sure that data like heart rate, steps, distance etc. are being shown on your watch app & on Google Fit app & both are in sync.", "ar": "تأكد من عرض بيانات مثل معدل ضربات القلب والخطوات والمسافة وما إلى ذلك على تطبيق الساعة وعلى تطبيق Google Fit وكلاهما في حالة مزامنة." },
"onlineTag": {"en": "Online", "ar": "متصل"},
"offlineTag": {"en": "Offline", "ar": "غير متصل"},
"viewDocList": {"en": "View List of Doctors", "ar": "عرض قائمة الأطباء"},
"bodyFatTitle": {"en": "Body Fat", "ar": " الدهون في الجسم"},
};

@ -13,6 +13,9 @@ class BariatricsService extends BaseService {
List<GetDoctorListModel> doctorList = [];
List<DoctorListByTimeModel> doctorListByTime = [];
double lat;
double long;
Future getClinicCategory() async {
hasError = false;
Map<String, dynamic> body = Map();
@ -104,12 +107,20 @@ class BariatricsService extends BaseService {
}
Future getCalculationDoctors({@required int calculationID}) async {
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
hasError = false;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['CalculationID'] = calculationID; // hint: it is static depend on IONIC project
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['Latitude'] = lat != null ? lat.toString() : 0;
body['Longitude'] = long != null ? long.toString() : 0;
dynamic localRes;

@ -1,9 +1,15 @@
import 'dart:collection';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -61,9 +67,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
activeColor: Colors.blue.shade700,
value: item.diseasesID,
groupValue: _selectedDisease != null ? _selectedDisease.diseasesID : -1,
selected: _selectedDisease != null
? item.diseasesID == _selectedDisease.diseasesID
: false,
selected: _selectedDisease != null ? item.diseasesID == _selectedDisease.diseasesID : false,
onChanged: (val) {
setState(() {
_selectedDisease = item;
@ -95,10 +99,14 @@ class _BariatricsPageState extends State<BariatricsPage> {
radius: 8,
fontWeight: FontWeight.bold,
handler: () async {
Navigator.push(
context,
FadePage(page: DoctorList(diseaseByClinic: _selectedDisease,)),
);
callDoctorsSearchAPI();
// Navigator.push(
// context,
// FadePage(
// page: DoctorList(
// diseaseByClinic: _selectedDisease,
// )),
// );
},
),
),
@ -116,10 +124,11 @@ class _BariatricsPageState extends State<BariatricsPage> {
borderColor: Color(0x00000000),
fontWeight: FontWeight.bold,
handler: () async {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
callDoctorsSearchAPI();
// Navigator.push(
// context,
// FadePage(page: DoctorList()),
// );
},
),
),
@ -129,6 +138,65 @@ class _BariatricsPageState extends State<BariatricsPage> {
);
}
callDoctorsSearchAPI() {
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
});
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) {
setState(() {
// dropdownValue = null;
});
// getProjectsList();
});
}
_getImageName(int gender, double obeseResult, bool isArabic) {
String path = "assets/images/BMI/";
double result = obeseResult;

@ -1,4 +1,5 @@
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';
@ -123,7 +124,9 @@ class _BmrCalculatorState extends State<BmrCalculator> {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: 'Bmr Calculator',
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bmr,
showHomeAppBarIcon: false,
appBarIcons: [
Padding(

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -9,13 +13,17 @@ import 'package:percent_indicator/circular_percent_indicator.dart';
class BmrResultPage extends StatelessWidget {
final double bmrResult;
final double calories;
BmrResultPage({this.bmrResult, this.calories});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: 'BMR Calculator',
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bmr,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
@ -58,16 +66,66 @@ class BmrResultPage extends StatelessWidget {
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
label: TranslationBase.of(context).viewDocList,
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
getDoctorsList(context);
}),
),
],
),
);
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 3).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -1,5 +1,6 @@
import 'dart:math';
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';
@ -210,8 +211,10 @@ class _BodyFatState extends State<BodyFat> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Body Fat',
showHomeAppBarIcon: false,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),

@ -1,4 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -12,7 +16,9 @@ class FatResult extends StatelessWidget {
final String textResult;
FatResult({this.bodyFat, this.fat, this.textResult = ''});
Color inductorColor;
Color colorInductor() {
if (bodyFat >= 17) {
inductorColor = Color(0xffC70D00);
@ -30,7 +36,10 @@ class FatResult extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Body Fat',
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
@ -69,12 +78,9 @@ class FatResult extends StatelessWidget {
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
label: TranslationBase.of(context).viewDocList,
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
getDoctorsList(context);
},
),
),
@ -82,4 +88,57 @@ class FatResult extends StatelessWidget {
),
);
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 5).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -15,9 +18,11 @@ class CalorieResultPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowDecPage: false,
appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calculators}",
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
@ -52,12 +57,9 @@ class CalorieResultPage extends StatelessWidget {
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
label: TranslationBase.of(context).viewDocList,
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
getDoctorsList(context);
},
),
),
@ -65,4 +67,57 @@ class CalorieResultPage extends StatelessWidget {
),
);
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 2).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -81,8 +82,10 @@ class _CarbsState extends State<Carbs> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Carb Protein Fat',
showHomeAppBarIcon: false,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).carbohydrate,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),

@ -1,5 +1,9 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -32,7 +36,10 @@ class CarbsResult extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Carb Protein Fat',
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).carbohydrate,
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -156,27 +163,68 @@ class CarbsResult extends StatelessWidget {
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
label: TranslationBase.of(context).viewDocList,
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
getDoctorsList(context);
},
),
),
],
),
// Texts(pCal.ceil().toString()),
// Texts(cCal.ceil().toString()),
// Texts(fCal.ceil().toString()),
// Texts(pCalGram.ceil().toString()),
// Texts(cCalGram.ceil().toString()),
// Texts(fCalGram.ceil().toString()),
// Texts(pCalMeal.ceil().toString()),
// Texts(cCalMeal.ceil().toString()),
// Texts(fCalMeal.ceil().toString()),
);
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 11).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -1,4 +1,5 @@
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';
@ -100,7 +101,10 @@ class _IdealBodyState extends State<IdealBody> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Ideal Body Weight',
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).idealBody,
showHomeAppBarIcon: false,
appBarIcons: [
Padding(

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/doctor_list.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -14,11 +17,15 @@ class IdealBodyResult extends StatelessWidget {
final String textResult;
IdealBodyResult({this.idealBodyWeight, this.minRange, this.mixRange, this.overWeightBy, this.textResult});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Ideal Body Weight',
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).idealBody,
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -81,8 +88,7 @@ class IdealBodyResult extends StatelessWidget {
children: [
Texts('This means that the weight is a little bit more than ideal weight by'),
Texts(overWeightBy.toStringAsFixed(1)),
Texts(
'May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'),
],
)
: overWeightBy >= 18
@ -104,8 +110,7 @@ class IdealBodyResult extends StatelessWidget {
SizedBox(
height: 25.0,
),
Texts(
'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
],
),
)
@ -148,20 +153,16 @@ class IdealBodyResult extends StatelessWidget {
SizedBox(
height: 25.0,
),
Texts(
'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
Texts('May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'),
],
),
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
label: TranslationBase.of(context).viewDocList,
onTap: () {
Navigator.push(
context,
FadePage(page: DoctorList()),
);
getDoctorsList(context);
},
),
),
@ -169,4 +170,57 @@ class IdealBodyResult extends StatelessWidget {
),
);
}
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
BariatricsService service = new BariatricsService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getCalculationDoctors(calculationID: 4).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList();
docList.clinicID = item['ClinicID'];
docList.clinicName = item['ClinicName'];
docList.doctorID = item['DoctorID'];
docList.doctorImageURL = item['DoctorImageURL'];
docList.name = item['DoctorName'];
docList.doctorTitle = item['DoctorTitle'];
docList.gender = item['Gender'];
docList.genderDescription = item['GenderDescription'];
docList.nationalityName = item['Nationality'];
docList.nationalityFlagURL = item['NationalityFlagURL'];
docList.projectID = item['ProjectID'];
docList.projectName = item['ProjectName'];
docList.actualDoctorRate = 0;
doctorsList.add(docList);
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
_patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
}
});
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
}
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -2567,6 +2567,10 @@ class TranslationBase {
String get onlineTag => localizedValues["onlineTag"][locale.languageCode];
String get offlineTag => localizedValues["offlineTag"][locale.languageCode];
String get viewDocList => localizedValues["viewDocList"][locale.languageCode];
String get bodyFatTitle => localizedValues["bodyFatTitle"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save