working on bmi calculator design and functionality

merge-requests/262/head^2
mosazaid 5 years ago
parent f6fd7587f2
commit 822defbd04

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi';
const PACKAGES_CATEGORIES = '/api/categories';
const PACKAGES_PRODUCTS = '/api/products';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/';
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -415,7 +415,9 @@ const GET_SUB_CATEGORISE =
const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_FINAL_PRODUCTS =
'epharmacy/api/products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
const TIMER_MIN = 10;

@ -1625,5 +1625,42 @@ const Map localizedValues = {
"en": "To view the terms and conditions",
"ar": "لعرض الشروط والأحكام"
},
"generalHealth": {"en": "General Health", "ar": "صحة عامة"},
"womanHealth": {"en": "Women's Health", "ar": "صحة المرأة"},
"bmi": {"en": "BMI", "ar": "الكتلة"},
"calc-health": {"en": "Calculators", "ar": "الصحية"},
"calories": {"en": "Calories", "ar": "سعرات"},
"bmr": {"en": "BMR", "ar": "معدل الأيض القاعدي"},
"idealBody": {"en": "Ideal Body", "ar": "الجسم المثالي"},
"body_word": {"en": "Body", "ar": "الجسم"},
"fat": {"en": "Fat", "ar": "دهون"},
"carbohydrate": {"en": "Carbohydrate", "ar": "كربوهيدرات"},
"proteinFat": {"en": "Protein Fat", "ar": "دهون البروتين"},
"ovulation": {"en": "Ovulation", "ar": "الإباضة"},
"delivery": {"en": "Delivery", "ar": "الولادة"},
"bmiCalcDesc": {
"en":
"'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding'",
"ar":
"حساب قيمة مؤشر كتلة الجسم وحالة الوزن لتحديد الوزن الصحي. \n وغير مناسب للأطفال والنساء الحوامل أو المرضعات"
},
"selectUnit": {"en": "Select Unit", "ar": "اختر الوحدة"},
"feet": {"en": "Feet", "ar": "قدم"},
"pound": {"en": "Pound", "ar": "رطل"},
"seeListOfDoctor": {"en": "See List Of Doctors", "ar": "انظر قائمة الأطباء"},
"obese": {"en": "Obese", "ar": "سمين"},
"overWeight": {"en": "OverWeight", "ar": "وزن زائد"},
"healthy": {"en": "Healthy", "ar": "صحي"},
"underWeight": {"en": "UnderWeight", "ar": "نقص الوزن"},
"bmiCalcMsgObese": {"en" : "A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.", "ar": "يشير مؤشر كتلة الجسم الذي يزيد عن 30 إلى زيادة الوزن بشكل كبير. قد تكون الصحة في خطر إذا لم تفقد الوزن. يوصى بالتحدث إلى الطبيب أو أخصائي التغذية للحصول على المشورة. لحجز موعد ، انقر أدناه للبدء."},
"bmiCalcMsgOverweight": {"en" : 'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get ', "ar": "يشير مؤشر كتلة الجسم من 25 إلى 30 إلى زيادة الوزن قليلاً. قد ينصح بفقدان بعض الوزن لأسباب صحية. يوصى بالتحدث إلى الطبيب أو أخصائي التغذية للحصول على المشورة. لحجز موعد ، انقر أدناه للحصول على"},
"bmiCalcMsgHealthy": {"en" : "A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.", "ar": "يشير مؤشر كتلة الجسم من 18.5 - 25 إلى وزن صحي بالنسبة للطول. بالحفاظ على وزن صحي ، قلل من خطر الإصابة بمشاكل صحية خطيرة. لحجز موعد ، انقر أدناه للبدء."},
"bmiCalcMsgUnderWeight": {"en" : "A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.", "ar": "يشير مؤشر كتلة الجسم الذي يقل عن 18.5 إلى أنك تعاني من نقص الوزن ، لذلك قد تحتاج إلى زيادة الوزن. يوصى بالتحدث إلى الطبيب أو أخصائي التغذية للحصول على المشورة. لحجز موعد ، انقر أدناه للبدء."},
"bariatrics": {"en" : "Bariatrics", "ar": "طب السمنة"},
"bariatricsHeaderMsg": {"en" : "Choose one of the following symptoms to show the right doctors or choose a consultation to show all", "ar": "اختر أحد الأعراض التالية لتظهر للأطباء المناسبين أو اختر استشارة لإظهار الكل"},
"continue": {"en" : "CONTINUE", "ar": "إستمرار"},
"skip": {"en" : "SKIP", "ar": "تخطى"},
"calorieCalcDesc": {"en" : "Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity ", "ar": "يحسب السعرات الحرارية اليومية بناءً على عدة عوامل ، مثل الطول والوزن والعمر والجنس والنشاط البدني اليومي"},
"age11_120_years": {"en" : "The Age ( 11 - 120 ) yrs", "ar": "العمر (11 - 120) سنة"},
// "visit": {"en" : "Visit", "ar": "الزيارة"},
};

@ -0,0 +1,68 @@
class ClinicCategory {
int clinicID;
int categoryID;
String categoryName;
String categoryNameN;
String icon;
String bodyImageEN;
String fullImageEN;
String bodyImageAR;
String fullmageAR;
bool isActive;
bool isCategoryGroup;
Null sortOrderAR;
Null sortOrderEN;
String clinicName;
ClinicCategory(
{this.clinicID,
this.categoryID,
this.categoryName,
this.categoryNameN,
this.icon,
this.bodyImageEN,
this.fullImageEN,
this.bodyImageAR,
this.fullmageAR,
this.isActive,
this.isCategoryGroup,
this.sortOrderAR,
this.sortOrderEN,
this.clinicName});
ClinicCategory.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
categoryID = json['CategoryID'];
categoryName = json['CategoryName'];
categoryNameN = json['CategoryNameN'];
icon = json['Icon'];
bodyImageEN = json['BodyImageEN'];
fullImageEN = json['FullImageEN'];
bodyImageAR = json['BodyImageAR'];
fullmageAR = json['FullmageAR'];
isActive = json['IsActive'];
isCategoryGroup = json['IsCategoryGroup'];
sortOrderAR = json['SortOrderAR'];
sortOrderEN = json['SortOrderEN'];
clinicName = json['ClinicName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['CategoryID'] = this.categoryID;
data['CategoryName'] = this.categoryName;
data['CategoryNameN'] = this.categoryNameN;
data['Icon'] = this.icon;
data['BodyImageEN'] = this.bodyImageEN;
data['FullImageEN'] = this.fullImageEN;
data['BodyImageAR'] = this.bodyImageAR;
data['FullmageAR'] = this.fullmageAR;
data['IsActive'] = this.isActive;
data['IsCategoryGroup'] = this.isCategoryGroup;
data['SortOrderAR'] = this.sortOrderAR;
data['SortOrderEN'] = this.sortOrderEN;
data['ClinicName'] = this.clinicName;
return data;
}
}

@ -0,0 +1,44 @@
class DiseasesByClinic {
int diseasesID;
String diseasesEN;
String diseasesAR;
int diseasesCategoryID;
Null diseasesCategoryEN;
Null diseasesCategoryAR;
String diseases;
Null diseasesCategory;
DiseasesByClinic(
{this.diseasesID,
this.diseasesEN,
this.diseasesAR,
this.diseasesCategoryID,
this.diseasesCategoryEN,
this.diseasesCategoryAR,
this.diseases,
this.diseasesCategory});
DiseasesByClinic.fromJson(Map<String, dynamic> json) {
diseasesID = json['DiseasesID'];
diseasesEN = json['Diseases_EN'];
diseasesAR = json['Diseases_AR'];
diseasesCategoryID = json['Diseases_CategoryID'];
diseasesCategoryEN = json['Diseases_CategoryEN'];
diseasesCategoryAR = json['Diseases_CategoryAR'];
diseases = json['Diseases'];
diseasesCategory = json['Diseases_Category'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DiseasesID'] = this.diseasesID;
data['Diseases_EN'] = this.diseasesEN;
data['Diseases_AR'] = this.diseasesAR;
data['Diseases_CategoryID'] = this.diseasesCategoryID;
data['Diseases_CategoryEN'] = this.diseasesCategoryEN;
data['Diseases_CategoryAR'] = this.diseasesCategoryAR;
data['Diseases'] = this.diseases;
data['Diseases_Category'] = this.diseasesCategory;
return data;
}
}

@ -0,0 +1,76 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class BariatricsService extends BaseService {
List<ClinicCategory> clinicCategoryList = [];
List<DiseasesByClinic> diseasesList = [];
Future getClinicCategory() async {
hasError = false;
Map<String, dynamic> body = Map();
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
body['isDentalAllowedBackend'] = false;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
await baseAppClient.post(GET_CLINIC_CATEGORY,
onSuccess: (dynamic response, int statusCode) {
clinicCategoryList.clear();
if (response['ClinicCategoryList'] != null)
response['ClinicCategoryList'].forEach((city) {
clinicCategoryList.add(ClinicCategory.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getDiseaseByClinicId() async {
hasError = false;
Map<String, dynamic> body = Map();
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
await baseAppClient.post(GET_DISEASE_BY_CLINIC_ID,
onSuccess: (dynamic response, int statusCode) {
diseasesList.clear();
if (response['DiseasesByClinicList'] != null)
response['DiseasesByClinicList'].forEach((city) {
diseasesList.add(DiseasesByClinic.fromJson(city));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future searchDoctorsByTime(DiseasesByClinic disease) async {
hasError = false;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
body['ContinueDentalPlan'] = false;
body['DiseaseID'] = disease.diseasesID;
body['IsGetNearAppointment'] = false;
body['IsSearchAppointmnetByClinicID'] = true;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['Latitude'] = 0;
body['License'] = true;
body['Longitude'] = 0;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(SEARCH_DOCTOR_BY_TIME,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -46,7 +46,8 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE,'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
@ -58,7 +59,7 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
@ -152,14 +153,26 @@ class BaseAppClient {
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
}
else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){
onFailure(
parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
else if (!parsed['IsAuthenticated']) {
await logout();
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if(parsed['ErrorSearchMsg'] == null ){
onFailure("Server Error found with no available message",
statusCode);
}else {
onFailure(parsed['ErrorSearchMsg'],
statusCode);
}
} else {
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
}
} else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else {
@ -185,6 +198,7 @@ class BaseAppClient {
onFailure(e.toString(), -1);
}
}
Future navigateToAppUpdate(context, String text) async {
Navigator.pushReplacement(
context,
@ -194,9 +208,9 @@ class BaseAppClient {
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams,
bool isExternal = false}) async {
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams,
bool isExternal = false}) async {
String url;
if (isExternal) {
url = endPoint;
@ -234,9 +248,9 @@ class BaseAppClient {
getPharmacy(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
Map<String, String> queryParams}) async {
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
Map<String, String> queryParams}) async {
String url = PHARMACY_BASE_URL + endPoint;
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
@ -264,7 +278,10 @@ class BaseAppClient {
}
}
simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams}) async {
simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
String url = fullUrl;
var haveParams = (queryParams != null);
if (haveParams) {
@ -276,7 +293,10 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.get(
url.trim(),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
);
final int statusCode = response.statusCode;
@ -298,7 +318,8 @@ class BaseAppClient {
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context,listen: false);
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
model.setState(0, false);
@ -307,12 +328,13 @@ class BaseAppClient {
String getSessionId(String id) {
///return id.replaceAll(RegExp('/[^\w\s]/'), '');
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
}
static defaultHttpParameters() async {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
var params = {};
if (user != null) {
@ -330,4 +352,4 @@ class BaseAppClient {
return params;
}
}
}

@ -0,0 +1,48 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/core/model/AlHabibMedicalService/HealthCalculator/ClinicCategory.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../../locator.dart';
class BariatricsViewModel extends BaseViewModel {
BariatricsService _service = locator<BariatricsService>();
List<ClinicCategory> get clinicCategoryList => _service.clinicCategoryList;
List<DiseasesByClinic> get diseasesList => _service.diseasesList;
void getClinicCategory() async {
setState(ViewState.Busy);
await _service.getClinicCategory();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
getDiseaseByClinicId();
}
}
void getDiseaseByClinicId() async {
setState(ViewState.Busy);
await _service.getDiseaseByClinicId();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future searchDoctorsByTime(DiseasesByClinic disease) async {
setState(ViewState.Busy);
await _service.searchDoctorsByTime(disease);
if (_service.hasError) {
error = _service.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -18,6 +18,7 @@ import 'package:get_it/get_it.dart';
import 'core/service/AlHabibMedicalService/cmc_service.dart';
import 'core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'core/service/AlHabibMedicalService/e_referral_service.dart';
import 'core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'core/service/AuthenticatedUserObject.dart';
import 'core/service/appointment_rate_service.dart';
@ -67,6 +68,7 @@ import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/service/offers_service.dart';
import 'core/service/pharmacy_categorise_service.dart';
import 'core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'core/viewModels/TermsConditionsViewModel.dart';
import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'core/viewModels/appointment_rate_view_model.dart';
@ -210,6 +212,7 @@ void setupLocator() {
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService());
locator.registerLazySingleton(() => BariatricsService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -273,6 +276,7 @@ void setupLocator() {
//pharmacy
locator.registerFactory(() => PharmacyCategoriseViewModel());
locator.registerFactory(() => OffersCategoriseViewModel());
locator.registerFactory(() => BariatricsViewModel());
// Offer And Packages
//----------------------

@ -0,0 +1,190 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.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/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// TODO mosa_remark
class BariatricsPage extends StatefulWidget {
final age;
final gender;
final double obeseResult;
BariatricsPage(this.age, this.gender, this.obeseResult);
@override
_BariatricsPageState createState() => _BariatricsPageState();
}
class _BariatricsPageState extends State<BariatricsPage> {
DiseasesByClinic _selectedDisease;
@override
Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<BariatricsViewModel>(
onModelReady: (model) => model.getClinicCategory(),
builder: (_, model, w) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: "${TranslationBase
.of(context)
.bariatrics}",
baseViewModel: model,
body: Column(
children: [
Container(
margin: EdgeInsets.all(8.0),
child: Center(
child: Texts(TranslationBase
.of(context)
.bariatricsHeaderMsg),
),
),
Expanded(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 16.0, vertical: 8.0),
child: Row(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
...model.diseasesList
.map((item) =>
RadioListTile(
title: Texts("${item.diseases}"),
activeColor: Colors.blue.shade700,
value: item.diseasesID,
groupValue: _selectedDisease != null
? _selectedDisease.diseasesID
: -1,
selected: _selectedDisease != null ? item
.diseasesID ==
_selectedDisease.diseasesID : false,
onChanged: (val) {
setState(() {
_selectedDisease = item;
});
},
))
.toList()
],
),
),
),
Image.asset(
_getImageName(widget.gender, widget.obeseResult,
projectProvider.isArabic),
fit: BoxFit.cover,
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton(
TranslationBase
.of(context)
.continues,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.white,
vPadding: 8,
hPadding: 8,
backgroundColor: Theme
.of(context)
.primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: () async {
await model.searchDoctorsByTime(_selectedDisease);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => BariatricsPage()),
// );
},
),
),
Container(
margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16),
child: BorderedButton(
TranslationBase
.of(context)
.skip,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.blue,
vPadding: 8,
hPadding: 8,
backgroundColor: Color(0x00000000),
radius: 8,
hasBorder: true,
borderColor: Color(0x00000000),
fontWeight: FontWeight.bold,
handler: () async {
await model.searchDoctorsByTime(_selectedDisease);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => BariatricsPage()),
// );
},
),
),
],
),
),
);
}
_getImageName(int gender, double obeseResult, bool isArabic) {
String path = "assets/images/BMI/";
double result = obeseResult;
if (result < 18.5 && gender == 1) {
path += "bmi_blue_male";
} else if (result >= 18.5 && result <= 24.9 && gender == 1) {
path += "bmi_green_male";
} else if (result >= 25 && result <= 29.9 && gender == 1) {
path += "bmi_yellow_male";
} else if (result >= 30 && result <= 34.9 && gender == 1) {
path += "bmi_orange_male";
} else if (result >= 35 && gender == 1) {
path += "bmi_red_male";
} else if (result < 18.5 && gender == 2) {
path += "bmi_blue_female";
} else if (result >= 18.5 && result <= 24.9 && gender == 2) {
path += "bmi_green_female";
} else if (result >= 25 && result <= 29.9 && gender == 2) {
path += "bmi_yellow_female";
} else if (result >= 30 && result <= 34.9 && gender == 2) {
path += "bmi_orange_female";
} else if (result >= 35 && gender == 2) {
path += "bmi_red_female";
} else {
path += "default.png";
}
if (isArabic) {
path += "_ar.png";
} else {
path += "_en.png";
}
return path;
}
}

@ -1,3 +1,4 @@
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';
@ -27,6 +28,7 @@ class _BMICalculatorState extends State<BMICalculator> {
Color ftCard = inactiveCardColor;
Color lbCard = inactiveCardColor;
Color kgCard = activeCardColor;
void updateColor(int type) {
//MG/DLT card
if (type == 1) {
@ -84,31 +86,27 @@ class _BMICalculatorState extends State<BMICalculator> {
return bmiResult;
}
void showTextResult() {
void showTextResult(BuildContext context) {
if (bmiResult >= 30) {
textResult = 'Obese';
textResult = TranslationBase.of(context).obese;
} else if (bmiResult < 30 && bmiResult >= 25) {
textResult = 'OverWeight';
textResult = TranslationBase.of(context).overWeight;
} else if (bmiResult < 25 && bmiResult >= 18.5) {
textResult = 'Healthy';
textResult = TranslationBase.of(context).healthy;
} else if (bmiResult < 18.5) {
textResult = 'UnderWeight';
textResult = TranslationBase.of(context).underWeight;
}
}
void showMsg() {
void showMsg(BuildContext context) {
if (bmiResult >= 30) {
msg =
'A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.';
msg = TranslationBase.of(context).bmiCalcMsgObese;
} else if (bmiResult < 30 && bmiResult >= 25) {
msg =
'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get ';
msg = TranslationBase.of(context).bmiCalcMsgOverweight;
} else if (bmiResult < 25 && bmiResult >= 18.5) {
msg =
'A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.';
msg = TranslationBase.of(context).bmiCalcMsgHealthy;
} else if (bmiResult < 18.5) {
msg =
'A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.';
msg = TranslationBase.of(context).bmiCalcMsgUnderWeight;
}
}
@ -121,26 +119,27 @@ class _BMICalculatorState extends State<BMICalculator> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'BMI Calculator',
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Center(
child: Container(
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 15.0),
child: Text(
'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding',
TranslationBase.of(context).bmiCalcDesc,
style: TextStyle(fontSize: 18.0),
),
),
),
),
Container(
height: 200.0,
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
@ -151,7 +150,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Height'),
child: Texts(TranslationBase.of(context).height),
),
],
),
@ -241,7 +240,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Select Unit'),
child: Texts(TranslationBase.of(context).selectUnit),
),
],
),
@ -273,7 +272,8 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('CM')),
child: Center(
child: Texts(TranslationBase.of(context).cm)),
),
),
),
@ -302,7 +302,8 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('FT')),
child: Center(
child: Texts(TranslationBase.of(context).feet)),
),
),
),
@ -315,8 +316,8 @@ class _BMICalculatorState extends State<BMICalculator> {
height: 25.0,
),
Container(
height: 200.0,
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.0),
@ -327,7 +328,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Weight'),
child: Texts(TranslationBase.of(context).weight),
),
],
),
@ -417,7 +418,7 @@ class _BMICalculatorState extends State<BMICalculator> {
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Texts('Select Unit'),
child: Texts(TranslationBase.of(context).selectUnit),
),
],
),
@ -449,7 +450,8 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
child: Center(
child: Texts(TranslationBase.of(context).kg)),
),
),
),
@ -478,7 +480,9 @@ class _BMICalculatorState extends State<BMICalculator> {
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
child: Center(
child:
Texts(TranslationBase.of(context).pound)),
),
),
),
@ -491,15 +495,15 @@ class _BMICalculatorState extends State<BMICalculator> {
height: 25.0,
),
Container(
height: 50.0,
width: 350.0,
margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: EdgeInsets.symmetric(vertical: 8),
child: SecondaryButton(
label: 'CALCULATE',
label: TranslationBase.of(context).calculate,
onTap: () => {
setState(() {
calculateBMI();
showTextResult();
showMsg();
showTextResult(context);
showMsg(context);
{
Navigator.push(
context,

@ -1,5 +1,9 @@
import 'dart:ffi';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.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,6 +16,7 @@ class ResultPage extends StatelessWidget {
final String msg;
ResultPage({this.finalResult, this.textResult, this.msg});
Color inductorColor;
double percent;
@ -45,53 +50,74 @@ class ResultPage extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "BMI Calculator",
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
SizedBox(
// height: 40.0,
),
Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: percentInductor(),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Text(
finalResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
Container(
margin: EdgeInsets.only(top: 50),
child: Center(
child: CircularPercentIndicator(
radius: 220.0,
lineWidth: 20.0,
percent: percentInductor(),
center: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
finalResult.toStringAsFixed(1),
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 5.0,
),
Text(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
],
),
progressColor: colorInductor(),
backgroundColor: Colors.white,
),
),
),
SizedBox(
height: 5.0,
),
Text(
textResult,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Texts(msg),
),
],
),
progressColor: colorInductor(),
backgroundColor: Colors.white,
),
),
Container(
height: 120,
width: 280.0,
child: Texts(msg),
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: BorderedButton(
TranslationBase.of(context).seeListOfDoctor,
fontSize: SizeConfig.textMultiplier * 2.1,
textColor: Colors.white,
vPadding: 8,
hPadding: 8,
backgroundColor: Theme.of(context).primaryColor,
radius: 8,
fontWeight: FontWeight.bold,
handler: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BariatricsPage(1, 1, finalResult)),
);
},
),
),
],

@ -1,3 +1,4 @@
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';
@ -29,6 +30,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
int weight = 0;
double calories;
String dropdownValue;
void updateColor(int type) {
//MG/DLT card
if (type == 1) {
@ -102,89 +104,91 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Calorie Calculator',
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 890.0,
child: Column(
//mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: Texts(
'Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity rate',
),
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 10.0, vertical: 15.0),
child: Texts('Gender'),
),
Container(
width: 350,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(35.0),
color: Colors.white,
border: Border.all(
color: Colors.black45,
)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColor(1);
isMale = false;
});
},
child: Container(
height: 55.0,
width: 170.0,
decoration: BoxDecoration(
color: maleCard,
borderRadius: BorderRadius.circular(35.0),
isShowDecPage: false,
appBarTitle:
"${TranslationBase.of(context).calories} ${TranslationBase.of(context).calcHealth}",
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: Column(
//mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).calorieCalcDesc,
),
SizedBox(
height: 8.0,
),
Texts(TranslationBase.of(context).gender),
SizedBox(
height: 8.0,
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
color: Colors.white,
border: Border.all(
color: Colors.black45,
)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColor(1);
isMale = false;
});
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
color: maleCard,
borderRadius: BorderRadius.circular(30.0),
),
child: Center(
child: Texts(
TranslationBase.of(context).female)),
),
),
),
child: Center(child: Texts('FEMALE')),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColor(2);
isMale = true;
});
},
child: Container(
height: 55.0,
width: 170.0,
decoration: BoxDecoration(
color: femaleCard,
borderRadius: BorderRadius.circular(35.0),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
updateColor(2);
isMale = true;
});
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 16),
decoration: BoxDecoration(
color: femaleCard,
borderRadius: BorderRadius.circular(30.0),
),
child: Center(
child: Texts(
TranslationBase.of(context).male)),
),
),
),
child: Center(child: Texts('MALE')),
),
],
),
],
),
),
SizedBox(
height: 15.0,
),
Texts(
'The Age ( 11 - 120 ) yrs',
),
SizedBox(
height: 10.0,
),
Row(
children: [
),
SizedBox(
height: 12.0,
),
Texts(
TranslationBase.of(context).age11_120Years,
),
Container(
width: 340.0,
height: 60.0,
margin:
EdgeInsets.symmetric(horizontal: 4.0, vertical: 12.0),
decoration: BoxDecoration(
color: Colors.white,
),
@ -195,7 +199,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
width: 60,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
@ -206,12 +210,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(age.toString()),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Text(age.toString()),
),
),
),
Container(
height: 38.0,
padding:
EdgeInsets.symmetric(horizontal: 4),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
@ -274,16 +282,12 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
],
),
),
],
),
Texts(
'Height',
),
Row(
children: [
Texts(
TranslationBase.of(context).height,
),
Container(
width: 340.0,
height: 60.0,
margin:
EdgeInsets.symmetric(horizontal: 4.0, vertical: 12.0),
decoration: BoxDecoration(
color: Colors.white,
),
@ -305,12 +309,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(height.toString()),
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Center(
child: Text(height.toString()),
),
),
),
Container(
height: 38.0,
padding:
EdgeInsets.symmetric(horizontal: 4.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
@ -373,305 +381,309 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
],
),
),
],
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
],
color: cmCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('CM')),
),
),
Texts(
TranslationBase.of(context).selectUnit,
),
SizedBox(
height: 8.0,
),
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: ftCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
color: cmCard,
borderRadius: BorderRadius.circular(3.0),
),
],
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('Ft')),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts(TranslationBase.of(context).cm)),
),
),
),
),
),
],
),
SizedBox(
height: 5.0,
),
Texts(
'Weight',
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
GestureDetector(
onTap: () {
setState(() {
updateColorHeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: ftCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(weight.toString()),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts(TranslationBase.of(context).feet))),
),
),
],
),
SizedBox(
height: 8.0,
),
// TODO MOSA
Texts(
'Weight',
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(weight.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (weight < 250)
weight++;
});
},
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 0) weight--;
});
},
),
onTap: () {
setState(() {
if (weight < 250) weight++;
});
},
),
],
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 0) weight--;
});
},
),
],
),
),
],
),
],
),
),
),
),
),
Expanded(
child: Slider(
value: weight.toDouble(),
min: 0,
max: 250,
onChanged: (double newValue) {
setState(() {
weight = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
Expanded(
child: Slider(
value: weight.toDouble(),
min: 0,
max: 250,
onChanged: (double newValue) {
setState(() {
weight = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
],
),
),
],
),
],
),
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
Texts('Select Unit'),
SizedBox(
height: 5.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(1);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
],
color: kgCard,
borderRadius: BorderRadius.circular(3.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Center(child: Texts('KG')),
),
),
),
),
),
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
GestureDetector(
onTap: () {
setState(() {
updateColorWeight(2);
});
},
child: Container(
height: 55.0,
width: 150.0,
decoration: BoxDecoration(
color: lbCard,
borderRadius: BorderRadius.circular(3.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 3,
blurRadius: 7,
offset: Offset(
0, 3), // changes position of shadow
),
],
),
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
),
],
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(child: Texts('LB')),
],
),
SizedBox(
height: 5.0,
),
Texts('Activity level'),
Container(
width: 300,
child: DropdownButton<String>(
value: dropdownValue,
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
color: Colors.black54,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>[
'Almost Inactive(Little or no exercises)',
'Lighty Active (1-3) days per week',
'very Active(6-7) days per week',
'Super Active(very hard exercises)'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
],
),
SizedBox(
height: 5.0,
),
Texts('Activity level'),
Container(
width: 300,
child: DropdownButton<String>(
value: dropdownValue,
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
style: TextStyle(color: Colors.black87),
underline: Container(
height: 2,
color: Colors.black54,
SizedBox(
height: 25.0,
),
onChanged: (String newValue) {
setState(() {
dropdownValue = newValue;
});
},
items: <String>[
'Almost Inactive(Little or no exercises)',
'Lighty Active (1-3) days per week',
'very Active(6-7) days per week',
'Super Active(very hard exercises)'
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
SizedBox(
height: 25.0,
),
Container(
height: 100.0,
width: 350.0,
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {
calculateCalories();
print(calories);
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CalorieResultPage(
calorie: calories,
)),
);
}
});
},
),
],
),
],
),
),
),
Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
child: SecondaryButton(
label: 'CALCULATE',
onTap: () {
setState(() {
calculateCalories();
print(calories);
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CalorieResultPage(
calorie: calories,
)),
);
}
});
},
),
),
),
],
),
);
}

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculat
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -37,7 +38,8 @@ class _HealthCalculatorsState extends State<HealthCalculators>
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Health Calculators',
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).calculators,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
@ -72,13 +74,13 @@ class _HealthCalculatorsState extends State<HealthCalculators>
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts('General Health'),
child: Texts(TranslationBase.of(context).generalHealth),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: Center(
child: Texts("Women's Health"),
child: Texts(TranslationBase.of(context).womanHealth),
),
),
],
@ -115,9 +117,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'BMI',
title: TranslationBase.of(context).bmi,
imagePath: 'bmi_health_calculator.png',
subTitle: 'Calculators',
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -133,9 +135,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Calories',
title: TranslationBase.of(context).calories,
imagePath: 'calories-calculator.png',
subTitle: 'Calculators',
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -155,9 +157,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'BMR',
title: TranslationBase.of(context).bmr,
imagePath: 'BMR_calculator.png',
subTitle: 'Calculators',
subTitle: TranslationBase.of(context).calcHealth,
),
),
),
@ -173,9 +175,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Ideal Body',
title: TranslationBase.of(context).idealBody,
imagePath: 'body_weight.png',
subTitle: 'Weight',
subTitle: TranslationBase.of(context).weight,
),
),
),
@ -195,9 +197,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Body',
title: TranslationBase.of(context).bodyWord,
imagePath: 'body_fat.png',
subTitle: 'Fat',
subTitle: TranslationBase.of(context).fat,
),
),
),
@ -213,9 +215,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Carbohydrate',
title: TranslationBase.of(context).carbohydrate,
imagePath: 'carb_protein.png',
subTitle: 'Protein Fat',
subTitle: TranslationBase.of(context).proteinFat,
),
),
),
@ -243,9 +245,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Ovulation',
title: TranslationBase.of(context).ovulation,
imagePath: 'ovulation_period_icon.png',
subTitle: 'Period',
subTitle: TranslationBase.of(context).period,
),
),
),
@ -261,9 +263,9 @@ class _HealthCalculatorsState extends State<HealthCalculators>
);
},
child: MedicalProfileItem(
title: 'Delivery',
title: TranslationBase.of(context).delivery,
imagePath: 'delivery_date_icon.png',
subTitle: 'Due Date',
subTitle: TranslationBase.of(context).dueDate,
),
),
),

@ -213,6 +213,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
}
// TODO Mosa_REMARk to come back later
getDoctorsList(BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
SearchInfo searchInfo = new SearchInfo();

@ -1373,8 +1373,39 @@ class TranslationBase {
String get bloodDEnterDesc =>
localizedValues["bloodD-enter-desc"][locale.languageCode];
String get viewTermsConditions =>
localizedValues["viewTermsConditions"][locale.languageCode];
String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode];
String get generalHealth => localizedValues["generalHealth"][locale.languageCode];
String get womanHealth => localizedValues["womanHealth"][locale.languageCode];
String get bmi => localizedValues["bmi"][locale.languageCode];
String get calcHealth => localizedValues["calc-health"][locale.languageCode];
String get calories => localizedValues["calories"][locale.languageCode];
String get bmr => localizedValues["bmr"][locale.languageCode];
String get idealBody => localizedValues["idealBody"][locale.languageCode];
String get bodyWord => localizedValues["body_word"][locale.languageCode];
String get fat => localizedValues["fat"][locale.languageCode];
String get carbohydrate => localizedValues["carbohydrate"][locale.languageCode];
String get proteinFat => localizedValues["proteinFat"][locale.languageCode];
String get ovulation => localizedValues["ovulation"][locale.languageCode];
String get delivery => localizedValues["delivery"][locale.languageCode];
String get bmiCalcDesc => localizedValues["bmiCalcDesc"][locale.languageCode];
String get selectUnit => localizedValues["selectUnit"][locale.languageCode];
String get feet => localizedValues["feet"][locale.languageCode];
String get pound => localizedValues["pound"][locale.languageCode];
String get seeListOfDoctor => localizedValues["seeListOfDoctor"][locale.languageCode];
String get obese => localizedValues["obese"][locale.languageCode];
String get overWeight => localizedValues["overWeight"][locale.languageCode];
String get healthy => localizedValues["healthy"][locale.languageCode];
String get underWeight => localizedValues["underWeight"][locale.languageCode];
String get bmiCalcMsgObese => localizedValues["bmiCalcMsgObese"][locale.languageCode];
String get bmiCalcMsgOverweight => localizedValues["bmiCalcMsgOverweight"][locale.languageCode];
String get bmiCalcMsgHealthy => localizedValues["bmiCalcMsgHealthy"][locale.languageCode];
String get bmiCalcMsgUnderWeight => localizedValues["bmiCalcMsgUnderWeight"][locale.languageCode];
String get bariatrics => localizedValues["bariatrics"][locale.languageCode];
String get bariatricsHeaderMsg => localizedValues["bariatricsHeaderMsg"][locale.languageCode];
String get continues => localizedValues["continue"][locale.languageCode];
String get skip => localizedValues["skip"][locale.languageCode];
String get calorieCalcDesc => localizedValues["calorieCalcDesc"][locale.languageCode];
String get age11_120Years => localizedValues["age11_120_years"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -191,6 +191,7 @@ flutter:
- assets/images/login/
- assets/images/SmartWatches/
- assets/images/DQ/
- assets/images/BMI/
- assets/json/
- assets/sounds/
- assets/images/svg/

Loading…
Cancel
Save