Design Updated for tracker

merge-requests/390/head
Sultan Khan 4 years ago
parent d2d22ff1fc
commit 0086875d0d

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -1417,10 +1417,7 @@ const Map localizedValues = {
}, },
"dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"}, "dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"},
"time-needed": {"en": "Time Needed:", "ar": "الوقت اللازم:"}, "time-needed": {"en": "Time Needed:", "ar": "الوقت اللازم:"},
"total-time-needed": { "total-time-needed": {"en": "Total Appointment Time:", "ar": "وقت المواعيد الكلي:"},
"en": "Total Appointment Time:",
"ar": "وقت المواعيد الكلي:"
},
"info-eye": { "info-eye": {
"en": "This service allows you to view all the eye measurements, lenses, and eyeglasses that have been made in the Habib Medical Group.", "en": "This service allows you to view all the eye measurements, lenses, and eyeglasses that have been made in the Habib Medical Group.",
"ar": " خدمة قياسات النظر: هذه الخدمة تمكنك من الاطلاع على جميع قياسات النظر والعدسات والنظارات التي تمت في مجموعة الحبيب الطبية." "ar": " خدمة قياسات النظر: هذه الخدمة تمكنك من الاطلاع على جميع قياسات النظر والعدسات والنظارات التي تمت في مجموعة الحبيب الطبية."
@ -1434,27 +1431,35 @@ const Map localizedValues = {
"ar": "متابعة قراءاتي: هذه الخدمة تمكنك من تسجيل قراءات قياس السكر والضغط والوزن بشكل دوري ومن ثم الاطلاع عليها كمرجع وكذلك الاطلاع على الرسوم البيانية لمتابعة تطور الحالة." "ar": "متابعة قراءاتي: هذه الخدمة تمكنك من تسجيل قراءات قياس السكر والضغط والوزن بشكل دوري ومن ثم الاطلاع عليها كمرجع وكذلك الاطلاع على الرسوم البيانية لمتابعة تطور الحالة."
}, },
"info-health-data": { "info-health-data": {
"en": "This service is designed to allows you to synchronize the health data from your smart watches into your health record system in Habib Medical Group so that the doctors you are visiting can analyze your health & activity level.", "en":
"This service is designed to allows you to synchronize the health data from your smart watches into your health record system in Habib Medical Group so that the doctors you are visiting can analyze your health & activity level.",
"ar": "تم تصميم هذه الخدمة للسماح لك بمزامنة البيانات الصحية من ساعاتك الذكية الى نظام السجلات الصحية الخاص بك في مجموعة حبيب الطبية حتى يتمكن الأطباء الذين تزورهم من تحليل مستوى صحتك ونشاطك." "ar": "تم تصميم هذه الخدمة للسماح لك بمزامنة البيانات الصحية من ساعاتك الذكية الى نظام السجلات الصحية الخاص بك في مجموعة حبيب الطبية حتى يتمكن الأطباء الذين تزورهم من تحليل مستوى صحتك ونشاطك."
}, },
"info-ask-doc": { "info-ask-doc": {
"en": "This service allows you to ask the doctor you have visited during the last 14 days. When you receive a response from the doctor, you will be notified via the system to view the doctor's reply.", "en":
"This service allows you to ask the doctor you have visited during the last 14 days. When you receive a response from the doctor, you will be notified via the system to view the doctor's reply.",
"ar": "اسال طبيبك: هذه الخدمة تمكنك من توجيه استفسارات الى الطبيب الذي قمت بزيارته خلال اخر 14 يوم وكذلك عند تلقى الرد من الطبيب سوف يتم ابلاغك عن طريق النظام للاطلاع على رد الطبيب." "ar": "اسال طبيبك: هذه الخدمة تمكنك من توجيه استفسارات الى الطبيب الذي قمت بزيارته خلال اخر 14 يوم وكذلك عند تلقى الرد من الطبيب سوف يتم ابلاغك عن طريق النظام للاطلاع على رد الطبيب."
}, },
"info-auto-wifi": { "info-auto-wifi": {
"en": "This service allows you to connect to the Internet directly without the need for entering a user name or password.", "en": "This service allows you to connect to the Internet directly without the need for entering a user name or password.",
"ar": "الاتصال بالانترنت: هذه الخدمة تمكنك من الاتصال بالانترنت مباشرة دون الحاجة الى اسم مستخدم او كلمة مرور." "ar": "الاتصال بالانترنت: هذه الخدمة تمكنك من الاتصال بالانترنت مباشرة دون الحاجة الى اسم مستخدم او كلمة مرور."
}, },
"auto-wifi": { "auto-wifi": {"en": "Connect To Internet", "ar": "الإتصال بالإنترنت"},
"en": "Connect To Internet",
"ar": "الإتصال بالإنترنت"
},
"child-vaccine-info": { "child-vaccine-info": {
"en": "This service to remind you of the deadlines of the necessary vaccinations for your childs against diseases targeted by immunization according to the MOH vaccinations schedule by sending a reminding message and notifications of the vaccination date to the registered mobile phone.", "en":
"ar": "هذه الخدمة تم تصميمها لتذكيرك بالمواعيد النهائية للتحصينات اللازمة لطفلك ضد الأمراض المستهدفة بالتحصين وفقًا لجدول تطعيمات وزارة الصحة عن طريق إرسال رسالة تذكير وإشعارات عن مواعيد التطعيم على الجوال المسجل." "This service to remind you of the deadlines of the necessary vaccinations for your childs against diseases targeted by immunization according to the MOH vaccinations schedule by sending a reminding message and notifications of the vaccination date to the registered mobile phone.",
"ar":
"هذه الخدمة تم تصميمها لتذكيرك بالمواعيد النهائية للتحصينات اللازمة لطفلك ضد الأمراض المستهدفة بالتحصين وفقًا لجدول تطعيمات وزارة الصحة عن طريق إرسال رسالة تذكير وإشعارات عن مواعيد التطعيم على الجوال المسجل."
}, },
"h2o-info": { "h2o-info": {
"en": "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", "en":
"ar": "تم تصميم هذه الخدمة لمساعدتك في تحديد وتتبع كميات المياه التي يتوجب شربها بشكل يومي. كما توفر هذه الخدمة تذكيرات الجدول الزمني وتقدم تحليلًا إحصائيًا لمقدار ما استهلكته خلال اليوم أو الأسبوع أو الشهر." "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
"ar":
"تم تصميم هذه الخدمة لمساعدتك في تحديد وتتبع كميات المياه التي يتوجب شربها بشكل يومي. كما توفر هذه الخدمة تذكيرات الجدول الزمني وتقدم تحليلًا إحصائيًا لمقدار ما استهلكته خلال اليوم أو الأسبوع أو الشهر."
}, },
"sys/dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"},
"arm": {"en": "Arm", "ar": "الذراع"},
"remove-measure": {"en": "Remove this measure", "ar": "إزالة هذا القياس؟"},
"select-arm": {"en": "Select the Arm", "ar": "إختر الذراع"}
}; };

@ -2,6 +2,9 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/Weight/WeightHomePage.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -57,6 +60,15 @@ class CardCommonContact extends StatelessWidget {
} else if (type == 2) { } else if (type == 2) {
//LiveChatPage //LiveChatPage
Navigator.push(context, FadePage(page: LiveChatPage())); Navigator.push(context, FadePage(page: LiveChatPage()));
} else if (type == 3) {
//LiveChatPage
Navigator.push(context, FadePage(page: BloodSugarHomePage()));
} else if (type == 4) {
//LiveChatPage
Navigator.push(context, FadePage(page: BloodPressureHomePage()));
} else if (type == 5) {
//LiveChatPage
Navigator.push(context, FadePage(page: WeightHomePage()));
} }
} }
} }

@ -41,7 +41,7 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../../routes.dart'; import '../../routes.dart';
@ -601,31 +601,33 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
), ),
), ),
drawer: SafeArea(child: AppDrawer()), drawer: SafeArea(child: AppDrawer()),
extendBody: true, extendBody: false,
body: WillPopScope( body: WillPopScope(
onWillPop: onWillPop, onWillPop: onWillPop,
child: PageView( child: Stack(children: [
physics: NeverScrollableScrollPhysics(), PageView(
controller: pageController, physics: NeverScrollableScrollPhysics(),
children: [ controller: pageController,
HomePage2( children: [
goToMyProfile: () { HomePage2(
changeCurrentTab(1); goToMyProfile: () {
}, changeCurrentTab(1);
onLoginClick: () { },
login(); onLoginClick: () {
}, login();
onMedicalFileClick: () { },
changeCurrentTab(1); onMedicalFileClick: () {
}, changeCurrentTab(1);
},
),
MedicalProfilePageNew(),
Search(),
MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array
), ),
MedicalProfilePageNew(), RobotIcon()
Search(), ])),
MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array
),
),
bottomNavigationBar: BottomNavBar( bottomNavigationBar: BottomNavBar(
changeIndex: changeCurrentTab, changeIndex: changeCurrentTab,
index: currentTab, index: currentTab,

@ -15,6 +15,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class AddWeightPage extends StatefulWidget { class AddWeightPage extends StatefulWidget {
final WeightPressureViewModel model; final WeightPressureViewModel model;
@ -25,16 +26,7 @@ class AddWeightPage extends StatefulWidget {
final String measureTimeSelectedType; final String measureTimeSelectedType;
final int weightUnit; final int weightUnit;
AddWeightPage( AddWeightPage({Key key, this.model, this.isUpdate = false, this.dayWeightDate, this.lineItemNo, this.weightValue, this.measureTimeSelectedType, this.weightUnit}) : super(key: key);
{Key key,
this.model,
this.isUpdate = false,
this.dayWeightDate,
this.lineItemNo,
this.weightValue,
this.measureTimeSelectedType,
this.weightUnit})
: super(key: key);
@override @override
_AddWeightPageState createState() => _AddWeightPageState(); _AddWeightPageState createState() => _AddWeightPageState();
@ -62,8 +54,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
measureTimeSelectedType = widget.measureTimeSelectedType; measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureUnitEnList.contains(widget.measureTimeSelectedType)) if (measureUnitEnList.contains(widget.measureTimeSelectedType))
weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType); weightUnit = measureUnitEnList.indexOf(widget.measureTimeSelectedType);
else if (measureUnitArList.contains(widget.measureTimeSelectedType)) else if (measureUnitArList.contains(widget.measureTimeSelectedType)) weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
weightUnit = measureUnitArList.indexOf(widget.measureTimeSelectedType);
_weightValueController.text = widget.weightValue; _weightValueController.text = widget.weightValue;
validateForm(); validateForm();
} }
@ -74,211 +65,199 @@ class _AddWeightPageState extends State<AddWeightPage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
? TranslationBase.of(context).update showNewAppBar: true,
: TranslationBase.of(context).add, showNewAppBarTitle: true,
appBarIcons: widget.isUpdate body: SingleChildScrollView(
? [ physics: BouncingScrollPhysics(),
IconButton( child: Container(
icon: Icon(Icons.delete), margin: EdgeInsets.all(15),
color: Colors.white, child: Column(
onPressed: () { children: [
ConfirmDialog dialog = new ConfirmDialog( SizedBox(
context: context, height: 15,
confirmMessage: 'Remove this measure', ),
okText: TranslationBase.of(context).ok, NewTextFields(
cancelText: TranslationBase.of(context).cancel, hintText: TranslationBase.of(context).weightAdd,
okFunction: () async { controller: _weightValueController,
ConfirmDialog.closeAlertDialog(context); keyboardType: TextInputType.number,
onChanged: (value) => validateForm(),
GifLoaderDialogUtils.showMyDialog(context); fontWeight: FontWeight.normal,
widget.model fontSize: 14,
.deleteWeightResult(lineItemNo: widget.lineItemNo) ),
.then((value) { SizedBox(
GifLoaderDialogUtils.hideDialog(context); height: 8,
if (widget.model.state == ViewState.ErrorLocal) ),
AppToast.showErrorToast( InkWell(
message: widget.model.error); onTap: () {
else confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureUnitArList : measureUnitEnList);
Navigator.pop(context); },
}).catchError((e) { child: Container(
GifLoaderDialogUtils.hideDialog(context); padding: EdgeInsets.all(12),
AppToast.showErrorToast(message: widget.model.error); width: double.infinity,
}); height: 65,
}, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
cancelFunction: () => {}); child: Row(
dialog.showAlertDialog(context); mainAxisAlignment: MainAxisAlignment.spaceBetween,
}, children: [
) Texts(measureTimeSelectedType ?? TranslationBase.of(context).other),
] Icon(
: null, Icons.arrow_drop_down,
body: SingleChildScrollView( color: Colors.grey,
physics: BouncingScrollPhysics(), )
child: Container( ],
margin: EdgeInsets.all(15), ),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: TranslationBase.of(context).weightAdd,
controller: _weightValueController,
keyboardType: TextInputType.number,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureUnitArList
: measureUnitEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType ??
TranslationBase.of(context).other),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { DatePicker.showDatePicker(
DatePicker.showDatePicker( context,
context, showTitleActions: true,
showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1),
minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(),
maxTime: DateTime.now(), onConfirm: (date) {
onConfirm: (date) { setState(() {
setState(() { dayWeightDate = date;
dayWeightDate = date; });
}); },
}, currentTime: dayWeightDate,
currentTime: dayWeightDate, locale: projectViewModel.localeType,
locale: projectViewModel.localeType, );
); },
}, child: Container(
child: Container( padding: EdgeInsets.all(12),
padding: EdgeInsets.all(12), width: double.infinity,
width: double.infinity, height: 65,
height: 65, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
decoration: BoxDecoration( child: Row(
borderRadius: BorderRadius.circular(12), mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.white), children: [
child: Row( Texts(TranslationBase.of(context).date),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Texts(getDate()),
children: [ ],
Texts(TranslationBase.of(context).date), ),
Texts(getDate()),
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { DatePicker.showTimePicker(
DatePicker.showTimePicker( context,
context, showTitleActions: true,
showTitleActions: true, onConfirm: (date) {
onConfirm: (date) { setState(() {
setState(() { timeWeightDate = date;
timeWeightDate = date; });
}); },
}, currentTime: timeWeightDate,
currentTime: timeWeightDate, locale: projectViewModel.localeType,
locale: projectViewModel.localeType, );
); },
}, child: Container(
child: Container( padding: EdgeInsets.all(12),
padding: EdgeInsets.all(12), width: double.infinity,
width: double.infinity, height: 65,
height: 65, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
decoration: BoxDecoration( child: Row(
borderRadius: BorderRadius.circular(12), mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.white), children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), widget.isUpdate
], ? Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
child: Texts(
TranslationBase.of(context).delete,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.red[900],
),
onTap: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
})
],
))
: Container()
],
),
), ),
), ),
), bottomSheet: Container(
bottomSheet: Container( width: MediaQuery.of(context).size.width,
color: Colors.transparent, height: 70.0,
width: double.infinity, margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
height: MediaQuery.of(context).size.width * 0.2, child: Button(
child: Padding( onTap: () async {
padding: const EdgeInsets.all(15.0), if (_weightValueController.text.isNotEmpty) {
child: SecondaryButton( if (widget.isUpdate) {
loading: widget.model.state == ViewState.BusyLocal, GifLoaderDialogUtils.showMyDialog(context);
label: TranslationBase.of(context).save.toUpperCase(), widget.model
textColor: Colors.white, .updateWeightResult(
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
onTap: () { weightMeasured: _weightValueController.text.toString(),
if (_weightValueController.text.isNotEmpty) { weightUnit: weightUnit,
if (widget.isUpdate) { lineItemNo: widget.lineItemNo)
GifLoaderDialogUtils.showMyDialog(context); .then((value) {
widget.model GifLoaderDialogUtils.hideDialog(context);
.updateWeightResult( if (widget.model.state == ViewState.Error)
weightDate: AppToast.showErrorToast(message: widget.model.error);
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', else
weightMeasured: Navigator.pop(context);
_weightValueController.text.toString(), });
weightUnit: weightUnit, } else
lineItemNo: widget.lineItemNo) widget.model
.then((value) { .addWeightResult(
GifLoaderDialogUtils.hideDialog(context); weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
if (widget.model.state == ViewState.Error) weightMeasured: _weightValueController.text.toString(),
AppToast.showErrorToast(message: widget.model.error); weightUnit: weightUnit,
else )
Navigator.pop(context); .then((value) {
}); GifLoaderDialogUtils.hideDialog(context);
} else if (widget.model.state == ViewState.Error)
widget.model AppToast.showErrorToast(message: widget.model.error);
.addWeightResult( else
weightDate: Navigator.pop(context);
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', });
weightMeasured: _weightValueController.text.toString(), }
weightUnit: weightUnit, },
) label: TranslationBase.of(context).save.toUpperCase(),
.then((value) { backgroundColor: Colors.red[900],
GifLoaderDialogUtils.hideDialog(context); disabled: isButtonDisabled,
if (widget.model.state == ViewState.Error) ),
AppToast.showErrorToast(message: widget.model.error); ));
else
Navigator.pop(context);
});
}
}),
),
),
);
} }
String getDate() { String getDate() {
@ -308,8 +287,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
} }
void validateForm() { void validateForm() {
if (_weightValueController.text.length > 0 && if (_weightValueController.text.length > 0 && measureTimeSelectedType != null) {
measureTimeSelectedType != null) {
setState(() { setState(() {
isButtonDisabled = true; isButtonDisabled = true;
}); });

@ -42,6 +42,8 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).weight, appBarTitle: TranslationBase.of(context).weight,
appBarIcons: [ appBarIcons: [
IconButton( IconButton(

@ -15,6 +15,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class AddBloodPressurePage extends StatefulWidget { class AddBloodPressurePage extends StatefulWidget {
final DateTime bloodSugarDate; final DateTime bloodSugarDate;
@ -25,15 +26,7 @@ class AddBloodPressurePage extends StatefulWidget {
final String bloodDiastolicValue; final String bloodDiastolicValue;
final BloodPressureViewMode model; final BloodPressureViewMode model;
const AddBloodPressurePage( const AddBloodPressurePage({Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.model, this.bloodSystolicValue, this.bloodDiastolicValue})
{Key key,
this.bloodSugarDate,
this.measureTimeSelectedType,
this.isUpdate = false,
this.lineItemNo,
this.model,
this.bloodSystolicValue,
this.bloodDiastolicValue})
: super(key: key); : super(key: key);
@override @override
@ -42,8 +35,7 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> { class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController(); TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController _bloodDiastolicValueController = TextEditingController();
TextEditingController();
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
int measuredArm = 1; int measuredArm = 1;
@ -67,8 +59,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
measureTimeSelectedType = widget.measureTimeSelectedType; measureTimeSelectedType = widget.measureTimeSelectedType;
if (measureTimeEnList.contains(widget.measureTimeSelectedType)) if (measureTimeEnList.contains(widget.measureTimeSelectedType))
measuredArm = measureTimeEnList.indexOf(widget.measureTimeSelectedType); measuredArm = measureTimeEnList.indexOf(widget.measureTimeSelectedType);
else if (measureTimeArList.contains(widget.measureTimeSelectedType)) else if (measureTimeArList.contains(widget.measureTimeSelectedType)) measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
_bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue;
validateForm(); validateForm();
@ -80,221 +71,194 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
? TranslationBase.of(context).update showNewAppBar: true,
: TranslationBase.of(context).add, showNewAppBarTitle: true,
appBarIcons: widget.isUpdate body: SingleChildScrollView(
? [ physics: BouncingScrollPhysics(),
IconButton( child: Container(
icon: Icon(Icons.delete), margin: EdgeInsets.all(15),
color: Colors.white, child: Column(
onPressed: () { children: [
ConfirmDialog dialog = new ConfirmDialog( SizedBox(
context: context, height: 15,
confirmMessage: 'Remove this measure', ),
okText: TranslationBase.of(context).ok, NewTextFields(
cancelText: TranslationBase.of(context).cancel, hintText: TranslationBase.of(context).systolicAdd,
okFunction: () async { controller: _bloodSystolicValueController,
ConfirmDialog.closeAlertDialog(context); keyboardType: TextInputType.number,
maxLength: 3,
GifLoaderDialogUtils.showMyDialog(context); onChanged: (value) => validateForm(),
widget.model fontWeight: FontWeight.normal,
.deactivateDiabeticStatus( fontSize: 14,
lineItemNo: widget.lineItemNo) ),
.then((value) { SizedBox(
GifLoaderDialogUtils.hideDialog(context); height: 8,
if (widget.model.state == ViewState.ErrorLocal) ),
AppToast.showErrorToast( NewTextFields(
message: widget.model.error); hintText: TranslationBase.of(context).diastolicAdd,
else controller: _bloodDiastolicValueController,
Navigator.pop(context); keyboardType: TextInputType.number,
}).catchError((e) { maxLength: 3,
GifLoaderDialogUtils.hideDialog(context); onChanged: (value) => validateForm(),
AppToast.showErrorToast(message: widget.model.error); fontWeight: FontWeight.normal,
}); fontSize: 14,
}, ),
cancelFunction: () => {}); SizedBox(
dialog.showAlertDialog(context); height: 8,
}, ),
) InkWell(
] onTap: () {
: null, confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
body: SingleChildScrollView( },
physics: BouncingScrollPhysics(), child: Container(
child: Container( padding: EdgeInsets.all(12),
margin: EdgeInsets.all(15), width: double.infinity,
child: Column( height: 65,
children: [ decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
SizedBox( child: Row(
height: 15, mainAxisAlignment: MainAxisAlignment.spaceBetween,
), children: [
NewTextFields( Texts(measureTimeSelectedType),
hintText: TranslationBase.of(context).systolicAdd, Icon(
controller: _bloodSystolicValueController, Icons.arrow_drop_down,
keyboardType: TextInputType.number, color: Colors.grey,
maxLength: 3, )
onChanged: (value) => validateForm(), ],
), ),
SizedBox(
height: 8,
),
NewTextFields(
hintText: TranslationBase.of(context).diastolicAdd,
controller: _bloodDiastolicValueController,
keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureTimeArList
: measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureTimeSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
DatePicker.showDatePicker(context, setState(
showTitleActions: true, () {
minTime: DateTime(DateTime.now().year - 1, 1, 1), bloodSugarDate = date;
maxTime: DateTime.now(), onConfirm: (date) { },
setState( );
() { }, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
bloodSugarDate = date;
},
);
}, },
currentTime: bloodSugarDate, child: Container(
locale: projectViewModel.localeType); padding: EdgeInsets.all(12),
}, width: double.infinity,
child: Container( height: 65,
padding: EdgeInsets.all(12), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Row(
height: 65, mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration( children: [
borderRadius: BorderRadius.circular(12), Texts(TranslationBase.of(context).date),
color: Colors.white), Texts(getDate()),
child: Row( ],
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
DatePicker.showTimePicker(context, showTitleActions: true, setState(
onConfirm: (date) { () {
setState( timeSugarDate = date;
() { },
timeSugarDate = date; );
}, }, currentTime: timeSugarDate, locale: projectViewModel.localeType);
);
}, },
currentTime: timeSugarDate, child: Container(
locale: projectViewModel.localeType); padding: EdgeInsets.all(12),
}, width: double.infinity,
child: Container( height: 65,
padding: EdgeInsets.all(12), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Row(
height: 65, mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration( children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
borderRadius: BorderRadius.circular(12), ),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), widget.isUpdate
], ? Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
child: Texts(
TranslationBase.of(context).delete,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.red[900],
),
onTap: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
})
],
))
: Container()
],
),
), ),
), ),
), bottomSheet: Container(
bottomSheet: Container( width: MediaQuery.of(context).size.width,
color: Colors.transparent, height: 70.0,
width: double.infinity, margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
height: MediaQuery.of(context).size.height * 0.10, child: Button(
child: FractionallySizedBox( onTap: () async {
widthFactor: 0.9, if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
child: Column( GifLoaderDialogUtils.showMyDialog(context);
children: [
Container(
height: 50,
child: SecondaryButton(
loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty &&
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.addORUpdateDiabtecResult( .addORUpdateDiabtecResult(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
bloodPressureDate: bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', diastolicPressure: _bloodDiastolicValueController.text.toString(),
diastolicPressure: systolicePressure: _bloodSystolicValueController.text.toString(),
_bloodDiastolicValueController.text.toString(), measuredArm: measuredArm,
systolicePressure: )
_bloodSystolicValueController.text.toString(), .then((value) {
measuredArm: measuredArm, GifLoaderDialogUtils.hideDialog(context);
) if (widget.model.state == ViewState.BusyLocal)
.then((value) { AppToast.showErrorToast(message: widget.model.error);
GifLoaderDialogUtils.hideDialog(context); else
if (widget.model.state == ViewState.BusyLocal) Navigator.pop(context);
AppToast.showErrorToast( ;
message: widget.model.error); }).catchError((e) {
else GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context); AppToast.showErrorToast(message: widget.model.error);
; });
}).catchError((e) { }
GifLoaderDialogUtils.hideDialog(context); },
AppToast.showErrorToast(message: widget.model.error); label: TranslationBase.of(context).save.toUpperCase(),
}); backgroundColor: Colors.red[900],
} disabled: isButtonDisabled,
}),
),
],
), ),
), ));
),
);
} }
String getDate() { String getDate() {
@ -310,7 +274,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
context: context, context: context,
child: RadioStringDialog( child: RadioStringDialog(
radioList: list, radioList: list,
title: 'Select the Arm', title: TranslationBase.of(context).selectArm,
selectedValue: measureTimeSelectedType, selectedValue: measureTimeSelectedType,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
@ -324,11 +288,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
} }
void validateForm() { void validateForm() {
print("_bloodSystolicValueController " + print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
_bloodSystolicValueController.text.length.toString()); if (measureTimeSelectedType != 'Left Arm' && _bloodSystolicValueController.text.length > 0 && _bloodDiastolicValueController.text.length > 0) {
if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) {
setState(() { setState(() {
isButtonDisabled = true; isButtonDisabled = true;
}); });

@ -14,14 +14,14 @@ import 'AddBloodPressurePage.dart';
import 'BloodPressureMonthly.dart'; import 'BloodPressureMonthly.dart';
import 'BloodPressureYeaPage.dart'; import 'BloodPressureYeaPage.dart';
import 'bloodPressureWeeklyPage.dart'; import 'bloodPressureWeeklyPage.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
class BloodPressureHomePage extends StatefulWidget { class BloodPressureHomePage extends StatefulWidget {
@override @override
_BloodPressureHomePageState createState() => _BloodPressureHomePageState(); _BloodPressureHomePageState createState() => _BloodPressureHomePageState();
} }
class _BloodPressureHomePageState extends State<BloodPressureHomePage> class _BloodPressureHomePageState extends State<BloodPressureHomePage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
@override @override
@ -41,78 +41,92 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage>
return BaseView<BloodPressureViewMode>( return BaseView<BloodPressureViewMode>(
onModelReady: (model) => model.getBloodPressure(), onModelReady: (model) => model.getBloodPressure(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodPressure, appBarTitle: TranslationBase.of(context).bloodPressure,
baseViewModel: model, showNewAppBar: true,
appBarIcons: [IconButton( showNewAppBarTitle: true,
icon: Icon(Icons.email), baseViewModel: model,
color: Colors.white, body: Scaffold(
onPressed: () { extendBodyBehindAppBar: true,
showDialog( appBar: TabBarWidget(
context: context, tabController: _tabController,
child: ConfirmSendEmailDialog( ),
email: model.user.emailAddress, body: Column(
onTapSendEmail: () async{ children: <Widget>[
GifLoaderDialogUtils.showMyDialog(context); Expanded(
model.sendReportByEmail().then((value) { child: TabBarView(
GifLoaderDialogUtils.hideDialog(context); physics: BouncingScrollPhysics(),
if(model.state == ViewState.ErrorLocal){ controller: _tabController,
AppToast.showErrorToast(message: model.error); children: <Widget>[
}else{ BloodPressureWeeklyPage(
AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, ); model: model,
} ),
}).catchError((e){ BloodPressureMonthlyPage(
GifLoaderDialogUtils.hideDialog(context); model: model,
AppToast.showErrorToast(message: model.error); ),
}); BloodPressureYearPage(
}, model: model,
), )
); ],
}, ),
),], )
body: Scaffold( ],
extendBodyBehindAppBar: true, ),
appBar: TabBarWidget(tabController: _tabController,), floatingActionButton: InkWell(
body: Column( onTap: () {
children: <Widget>[ Navigator.push(
Expanded( context,
child: TabBarView( FadePage(
physics: BouncingScrollPhysics(), page: AddBloodPressurePage(
controller: _tabController,
children: <Widget>[
BloodPressureWeeklyPage(
model: model,
),
BloodPressureMonthlyPage(
model: model,
),
BloodPressureYearPage(
model: model, model: model,
) )));
], },
), child: Container(
) width: 55,
], height: 55,
), decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
floatingActionButton: InkWell( child: Center(
onTap: () { child: Icon(
Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); Icons.add,
}, color: Colors.white,
child: Container( ),
width: 55,
height: 55,
decoration: BoxDecoration(
shape: BoxShape.circle, color: Theme.of(context).primaryColor),
child: Center(
child: Icon(
Icons.add,
color: Colors.white,
), ),
), ),
), ),
), bottomSheet: Container(
), width: MediaQuery.of(context).size.width,
), height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
label: TranslationBase.of(context).sendEmail,
backgroundColor: Colors.red[900],
),
),
)),
); );
} }
} }

@ -16,7 +16,6 @@ class BloodPressureMonthlyPage extends StatelessWidget {
const BloodPressureMonthlyPage({Key key, this.model}) : super(key: key); const BloodPressureMonthlyPage({Key key, this.model}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -24,36 +23,43 @@ class BloodPressureMonthlyPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: MonthCurvedChartBloodPressure( child: MonthCurvedChartBloodPressure(
horizontalInterval: 20.0, horizontalInterval: 20.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataTop, timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataTop,
timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataLow, timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
),
), ),
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( // Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details), // child: Texts(TranslationBase.of(context).details),
), // ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table( model.weighMonthTimeSeriesDataTop.isEmpty
border: TableBorder.symmetric( ? Container(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), child: Center(
), child: Texts(TranslationBase.of(context).noDataAvailable),
children: fullData(context,projectViewModel,model), ),
), )
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
SizedBox(height: 80)
], ],
), ),
) )
@ -62,8 +68,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context, List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode model) {
ProjectViewModel projectViewModel, BloodPressureViewMode model) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -78,7 +83,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Date', TranslationBase.of(context).date,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -93,7 +98,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Time', TranslationBase.of(context).time,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -107,7 +112,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Arm', TranslationBase.of(context).arm,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -124,7 +129,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'SBP/DBP', TranslationBase.of(context).sysdias,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -143,8 +148,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
'${projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate):DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}',
fontSize: 15, fontSize: 12,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@ -155,7 +160,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Center( child: Center(
child: Texts( child: Texts(
'${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', '${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}',
fontSize: 15, fontSize: 12,
), ),
), ),
height: 40), height: 40),
@ -164,7 +169,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Center( child: Center(
child: Texts( child: Texts(
diabtec.measuredArmDesc, diabtec.measuredArmDesc,
fontSize: 15, fontSize: 12,
), ),
), ),
height: 40), height: 40),
@ -174,7 +179,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Texts( child: Texts(
'${diabtec.systolicePressure}/${diabtec.diastolicPressure}', '${diabtec.systolicePressure}/${diabtec.diastolicPressure}',
color: Colors.red, color: Colors.red,
fontSize: 15, fontSize: 12,
), ),
), ),
height: 40), height: 40),

@ -19,38 +19,45 @@ class BloodPressureYearPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body:ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: CurvedChartBloodPressure( child: CurvedChartBloodPressure(
horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, horizontalInterval: 3.0, // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataTop, timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataTop,
timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataLow, timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( // Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details), // child: Texts(TranslationBase.of(context).details),
), // ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table( model.weightYearTimeSeriesDataTop.isEmpty
border: TableBorder.symmetric( ? Container(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), child: Center(
), child: Texts(TranslationBase.of(context).noDataAvailable),
children: fullData(context, projectViewModel, model), ),
), )
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
SizedBox(height: 80)
], ],
), ),
) )
@ -59,10 +66,7 @@ class BloodPressureYearPage extends StatelessWidget {
); );
} }
List<TableRow> fullData( List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) {
BuildContext context,
ProjectViewModel projectViewModel,
BloodPressureViewMode bloodSugarViewMode) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -72,12 +76,8 @@ class BloodPressureYearPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -123,12 +123,8 @@ class BloodPressureYearPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -22,38 +22,45 @@ class BloodPressureWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: CurvedChartBloodPressure( child: CurvedChartBloodPressure(
horizontalInterval:3.0, horizontalInterval: 3.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataTop, timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop,
timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataLow, timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( // Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details), // child: Texts(TranslationBase.of(context).details),
), // ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): Table( model.weightWeekTimeSeriesDataTop.isEmpty
border: TableBorder.symmetric( ? Container(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), child: Center(
), child: Texts(TranslationBase.of(context).noDataAvailable),
children: fullData(context, projectViewModel, model), ),
), )
: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel, model),
),
SizedBox(height: 80)
], ],
), ),
) )
@ -62,10 +69,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData( List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) {
BuildContext context,
ProjectViewModel projectViewModel,
BloodPressureViewMode bloodSugarViewMode) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -75,12 +79,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -140,12 +140,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
@ -25,15 +26,7 @@ class AddBloodSugarPage extends StatefulWidget {
final int lineItemNo; final int lineItemNo;
final BloodSugarViewMode bloodSugarViewMode; final BloodSugarViewMode bloodSugarViewMode;
AddBloodSugarPage( AddBloodSugarPage({Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode})
{Key key,
this.bloodSugarDate,
this.measureUnitSelectedType,
this.isUpdate = false,
this.measuredTime,
this.bloodSugarValue,
this.lineItemNo,
this.bloodSugarViewMode})
: super(key: key); : super(key: key);
@override @override
@ -83,8 +76,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
measureUnitSelectedType = widget.measureUnitSelectedType; measureUnitSelectedType = widget.measureUnitSelectedType;
if (measureTimeEnList.contains(widget.measuredTime)) if (measureTimeEnList.contains(widget.measuredTime))
measuredTime = measureTimeEnList.indexOf(widget.measuredTime); measuredTime = measureTimeEnList.indexOf(widget.measuredTime);
else if (measureTimeArList.contains(widget.measuredTime)) else if (measureTimeArList.contains(widget.measuredTime)) measuredTime = measureTimeArList.indexOf(widget.measuredTime);
measuredTime = measureTimeArList.indexOf(widget.measuredTime);
_bloodSugarValueController.text = widget.bloodSugarValue; _bloodSugarValueController.text = widget.bloodSugarValue;
validateForm(); validateForm();
} }
@ -94,246 +86,222 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate showNewAppBar: true,
? TranslationBase.of(context).update showNewAppBarTitle: true,
: TranslationBase.of(context).add, appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
appBarIcons: widget.isUpdate // appBarIcons: widget.isUpdate
? [ // ? [
IconButton( // IconButton(
icon: Icon(Icons.delete), // icon: Icon(Icons.delete),
color: Colors.white, // color: Colors.white,
onPressed: () { // onPressed: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); // },
widget.bloodSugarViewMode // )
.deactivateDiabeticStatus( // ]
lineItemNo: widget.lineItemNo) // : null,
.then((value) { body: SingleChildScrollView(
GifLoaderDialogUtils.hideDialog(context); physics: BouncingScrollPhysics(),
if (widget.bloodSugarViewMode.state == child: Container(
ViewState.ErrorLocal) margin: EdgeInsets.all(15),
AppToast.showErrorToast( child: Column(
message: widget.bloodSugarViewMode.error); children: [
else SizedBox(
Navigator.pop(context); height: 15,
}).catchError((e) { ),
GifLoaderDialogUtils.hideDialog(context); NewTextFields(
AppToast.showErrorToast( hintText: TranslationBase.of(context).sugarAdd,
message: widget.bloodSugarViewMode.error); controller: _bloodSugarValueController,
}); keyboardType: TextInputType.number,
}, onChanged: (value) => validateForm(),
cancelFunction: () => {}); fontWeight: FontWeight.normal,
dialog.showAlertDialog(context); fontSize: 14,
}, ),
) SizedBox(
] height: 8,
: null, ),
body: SingleChildScrollView( InkWell(
physics: BouncingScrollPhysics(), onTap: () {
child: Container( confirmSelectMeasureUnitDialog();
margin: EdgeInsets.all(15), },
child: Column( child: Container(
children: [ padding: EdgeInsets.all(12),
SizedBox( width: double.infinity,
height: 15, height: 65,
), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
NewTextFields( child: Row(
hintText: TranslationBase.of(context).sugarAdd, mainAxisAlignment: MainAxisAlignment.spaceBetween,
controller: _bloodSugarValueController, children: [
keyboardType: TextInputType.number, Texts(measureUnitSelectedType),
onChanged: (value) => validateForm(), Icon(
), Icons.arrow_drop_down,
SizedBox( color: Colors.grey,
height: 8, )
), ],
InkWell( ),
onTap: () {
confirmSelectMeasureUnitDialog();
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureUnitSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { DatePicker.showDatePicker(context, showTitleActions: true, minTime: DateTime(DateTime.now().year - 1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) {
DatePicker.showDatePicker(context, setState(() {
showTitleActions: true, bloodSugarDate = date;
minTime: DateTime(DateTime.now().year - 1, 1, 1), });
maxTime: DateTime.now(), onConfirm: (date) { }, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
setState(() { },
bloodSugarDate = date; child: Container(
}); padding: EdgeInsets.all(12),
}, width: double.infinity,
currentTime: bloodSugarDate, height: 65,
locale: projectViewModel.localeType); decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
}, child: Row(
child: Container( mainAxisAlignment: MainAxisAlignment.spaceBetween,
padding: EdgeInsets.all(12), children: [
width: double.infinity, Texts(TranslationBase.of(context).date),
height: 65, Texts(getDate()),
decoration: BoxDecoration( ],
borderRadius: BorderRadius.circular(12), ),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
DatePicker.showTimePicker(context, showTitleActions: true, setState(() {
onConfirm: (date) { timeSugarDate = date;
setState(() { });
timeSugarDate = date; }, currentTime: timeSugarDate, locale: projectViewModel.localeType);
}); },
}, child: Container(
currentTime: timeSugarDate, padding: EdgeInsets.all(12),
locale: projectViewModel.localeType); width: double.infinity,
}, height: 65,
child: Container( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
padding: EdgeInsets.all(12), child: Row(
width: double.infinity, mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 65, children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
decoration: BoxDecoration( ),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
confirmSelectMeasureTimeDialog(projectViewModel.isArabic },
? measureTimeArList child: Container(
: measureTimeEnList); padding: EdgeInsets.all(12),
}, width: double.infinity,
child: Container( height: 65,
padding: EdgeInsets.all(12), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Row(
height: 65, mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration( children: [
borderRadius: BorderRadius.circular(12), Texts(measureTimeSelectedType ?? TranslationBase.of(context).other),
color: Colors.white), Icon(
child: Row( Icons.arrow_drop_down,
mainAxisAlignment: MainAxisAlignment.spaceBetween, color: Colors.grey,
children: [ )
Texts(measureTimeSelectedType ?? ],
TranslationBase.of(context).other), ),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
), ),
), ),
), widget.isUpdate
], ? Container(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
child: Texts(
TranslationBase.of(context).delete,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.red[900],
),
onTap: () {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).removeMeasure,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
});
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
],
))
: Container()
],
),
), ),
), ),
), bottomSheet: Container(
bottomSheet: Container( width: MediaQuery.of(context).size.width,
color: Colors.transparent, height: 70.0,
width: double.infinity, margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
height: MediaQuery.of(context).size.height * 0.10, child: Button(
child: Column( onTap: () async {
children: [ if (_bloodSugarValueController.text.isNotEmpty) {
FractionallySizedBox( if (widget.isUpdate) {
widthFactor: 0.9, GifLoaderDialogUtils.showMyDialog(context);
child: SecondaryButton( await widget.bloodSugarViewMode.updateDiabtecResult(
label: TranslationBase.of(context).save.toUpperCase(), month: bloodSugarDate,
textColor: Colors.white, hour: timeSugarDate,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, diabtecUnit: measureUnitSelectedType,
onTap: () async { measuredTime: measuredTime,
if (_bloodSugarValueController.text.isNotEmpty) { lineItemNo: widget.lineItemNo,
if (widget.isUpdate) { bloodSugerResult: _bloodSugarValueController.text.toString());
GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode
.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult:
_bloodSugarValueController.text.toString());
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
ViewState.ErrorLocal) AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
AppToast.showErrorToast( else
message: widget.bloodSugarViewMode.error); Navigator.pop(context);
else } else {
Navigator.pop(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode.addDiabtecResult(
} else { diabtecUnit: measureUnitSelectedType,
GifLoaderDialogUtils.showMyDialog(context); measuredTime: measuredTime,
await widget.bloodSugarViewMode bloodSugerResult: _bloodSugarValueController.text.toString(),
.addDiabtecResult( bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diabtecUnit: measureUnitSelectedType, );
measuredTime: measuredTime,
bloodSugerResult:
_bloodSugarValueController.text.toString(),
bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
);
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
}
} GifLoaderDialogUtils.hideDialog(context);
}), if (widget.bloodSugarViewMode.state == ViewState.Error)
), AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
], else
), Navigator.pop(context);
), }
); }
},
label: TranslationBase.of(context).save.toUpperCase(),
backgroundColor: Colors.red[900],
disabled: isButtonDisabled,
),
));
} }
String getDate() { String getDate() {

@ -21,10 +21,7 @@ class BloodMonthlyPage extends StatelessWidget {
final List<TimeSeriesSales3> timeSeriesData; final List<TimeSeriesSales3> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode; final BloodSugarViewMode bloodSugarViewMode;
const BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
const BloodMonthlyPage(
{Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,9 +36,7 @@ class BloodMonthlyPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: MonthLineChartCurved( child: MonthLineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : timeSeriesData,
? [TimeSeriesSales3(0, 0.0)]
: timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5, indexes: timeSeriesData.length ~/ 5.5,
)), )),
SizedBox( SizedBox(
@ -60,17 +55,16 @@ class BloodMonthlyPage extends StatelessWidget {
timeSeriesData.isEmpty timeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts( child: Texts(TranslationBase.of(context).noDataAvailable),
TranslationBase.of(context).noDataAvailable),
), ),
) )
: Table( : Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: inside: BorderSide(width: 2.0, color: Colors.grey[300]),
BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(context, projectViewModel), children: fullData(context, projectViewModel),
), ),
SizedBox(height: 80)
], ],
), ),
) )
@ -79,8 +73,7 @@ class BloodMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData( List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel) {
BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -90,12 +83,8 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -141,12 +130,8 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(

@ -27,46 +27,47 @@ class BloodYearPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
// baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
body: ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite, width: double.maxFinite,
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData, timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5 ?? 0, indexes: timeSeriesData.length ~/ 5.5 ?? 0,
)), )),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
timeSeriesData.isEmpty timeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
:Table( : Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(context, projectViewModel), children: fullData(context, projectViewModel),
), ),
], SizedBox(height: 80)
),
)
], ],
), ),
)
],
),
); );
} }

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -26,8 +27,7 @@ class BloodSugarHomePage extends StatefulWidget {
_BloodSugarHomePageState createState() => _BloodSugarHomePageState(); _BloodSugarHomePageState createState() => _BloodSugarHomePageState();
} }
class _BloodSugarHomePageState extends State<BloodSugarHomePage> class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
@override @override
@ -47,38 +47,17 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
return BaseView<BloodSugarViewMode>( return BaseView<BloodSugarViewMode>(
onModelReady: (model) => model.getBloodSugar(), onModelReady: (model) => model.getBloodSugar(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
appBarIcons: [IconButton( showNewAppBar: true,
icon: Icon(Icons.email), isShowDecPage: true,
color: Colors.white, showNewAppBarTitle: true,
onPressed: () { baseViewModel: model,
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async{
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(model.state == ViewState.ErrorLocal){
AppToast.showErrorToast(message: model.error);
}else{
AppToast.showSuccessToast(message:TranslationBase.of(context).emailSentSuccessfully, );
}
}).catchError((e){
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
),],
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodSugar, appBarTitle: TranslationBase.of(context).bloodSugar,
// baseViewModel: model, // baseViewModel: model,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: TabBarWidget(tabController: _tabController,), appBar: TabBarWidget(
tabController: _tabController,
),
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -93,7 +72,8 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
), ),
BloodMonthlyPage( BloodMonthlyPage(
timeSeriesData: model.monthTimeSeriesData, timeSeriesData: model.monthTimeSeriesData,
diabtecPatientResult: model.monthDiabtecPatientResult, bloodSugarViewMode: model, diabtecPatientResult: model.monthDiabtecPatientResult,
bloodSugarViewMode: model,
), ),
BloodYearPage( BloodYearPage(
timeSeriesData: model.yearTimeSeriesData, timeSeriesData: model.yearTimeSeriesData,
@ -107,13 +87,17 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
), ),
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); Navigator.push(
context,
FadePage(
page: AddBloodSugarPage(
bloodSugarViewMode: model,
)));
}, },
child: Container( child: Container(
width: 55, width: 55,
height: 55, height: 55,
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.circle, color: Theme.of(context).primaryColor),
shape: BoxShape.circle, color:Theme.of(context).primaryColor),
child: Center( child: Center(
child: Icon( child: Icon(
Icons.add, Icons.add,
@ -122,6 +106,39 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
), ),
), ),
), ),
bottomSheet: Container(
width: MediaQuery.of(context).size.width,
height: 70.0,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
child: Button(
onTap: () {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: model.user.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).emailSentSuccessfully,
);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: model.error);
});
},
),
);
},
label: TranslationBase.of(context).sendEmail,
backgroundColor: Colors.red[900],
),
),
), ),
), ),
); );

@ -20,66 +20,61 @@ class BloodSugarWeeklyPage extends StatelessWidget {
final BloodSugarViewMode bloodSugarViewMode; final BloodSugarViewMode bloodSugarViewMode;
final List<TimeSeriesSales2> timeSeriesData; final List<TimeSeriesSales2> timeSeriesData;
BloodSugarWeeklyPage( BloodSugarWeeklyPage({Key key, this.diabtecPatientResult, this.bloodSugarViewMode, this.timeSeriesData}) : super(key: key);
{Key key,
this.diabtecPatientResult,
this.bloodSugarViewMode,
this.timeSeriesData})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
// baseViewModel: bloodSugarViewMode, // baseViewModel: bloodSugarViewMode,
body: ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData, timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5, indexes: timeSeriesData.length ~/ 5.5,
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
color: Colors.transparent, color: Colors.transparent,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
timeSeriesData.isEmpty timeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Texts(TranslationBase.of(context).noDataAvailable),
), ),
) )
:Table( : Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(context, projectViewModel, bloodSugarViewMode), children: fullData(context, projectViewModel, bloodSugarViewMode),
), ),
], SizedBox(
), height: 80,
) )
], ],
), ),
)
],
),
); );
} }
List<TableRow> fullData( List<TableRow> fullData(BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) {
BuildContext context,
ProjectViewModel projectViewModel,
BloodSugarViewMode bloodSugarViewMode) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -89,12 +84,8 @@ class BloodSugarWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -154,12 +145,8 @@ class BloodSugarWeeklyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
@ -186,7 +173,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
), ),

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart';
import 'Weight/WeightHomePage.dart'; import 'Weight/WeightHomePage.dart';
import 'blood_pressure/BloodPressureHomePage.dart'; import 'blood_pressure/BloodPressureHomePage.dart';
import 'blood_suger/blood_sugar_home_page.dart'; import 'blood_suger/blood_sugar_home_page.dart';
@ -15,110 +15,136 @@ class MyTrackers extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myTracker, appBarTitle: TranslationBase.of(context).myTracker,
isShowAppBar: true, showNewAppBar: true,
isShowDecPage: true, isShowDecPage: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8),
description: TranslationBase.of(context).infoTrackers, description: TranslationBase.of(context).infoTrackers,
imagesInfo: [ imagesInfo: [
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/ar/0.png') ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/ar/0.png')
], ],
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(12), child: GridView(
margin: EdgeInsets.all(12), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
child: Column( physics: NeverScrollableScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.all(21),
children: [ shrinkWrap: true,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( CardCommonContact(
child: InkWell( image: 'assets/tracker/blood-suger.png',
onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())), text: TranslationBase.of(context).bloodSugar,
child: Container( subText: "",
margin: EdgeInsets.all(5), type: 3,
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/tracker/blood-suger.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).bloodSugar),
],
),
),
),
),
Expanded(
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/tracker/blood-pressure.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).bloodPressure),
],
),
),
),
),
],
), ),
Row( CardCommonContact(
//mainAxisAlignment: MainAxisAlignment.spaceAround, image: 'assets/tracker/blood-pressure.png',
children: [ text: TranslationBase.of(context).bloodPressure,
Expanded( subText: "",
child: InkWell( type: 4,
onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())),
child: Container(
margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/tracker/weight.png',
width: 60.0,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).weight),
],
),
),
),
),
Expanded(
child: Container(),
),
],
), ),
], CardCommonContact(
), image: 'assets/tracker/weight.png',
), text: TranslationBase.of(context).weight,
subText: "",
type: 5,
)
])
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Expanded(
// child: InkWell(
// onTap: () => Navigator.push(context, FadePage(page: BloodSugarHomePage())),
// child: Container(
// margin: EdgeInsets.all(5),
// width: MediaQuery.of(context).size.width * 0.35,
// height: MediaQuery.of(context).size.width * 0.35,
// decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// 'assets/tracker/blood-suger.png',
// width: 60.0,
// ),
// SizedBox(
// height: 15,
// ),
// Texts(TranslationBase.of(context).bloodSugar),
// ],
// ),
// ),
// ),
// ),
// Expanded(
// child: InkWell(
// onTap: () => Navigator.push(context, FadePage(page: BloodPressureHomePage())),
// child: Container(
// margin: EdgeInsets.all(5),
// width: MediaQuery.of(context).size.width * 0.35,
// height: MediaQuery.of(context).size.width * 0.35,
// decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// 'assets/tracker/blood-pressure.png',
// width: 60.0,
// ),
// SizedBox(
// height: 15,
// ),
// Texts(TranslationBase.of(context).bloodPressure),
// ],
// ),
// ),
// ),
// ),
// ],
// ),
// Row(
// //mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: [
// Expanded(
// child: InkWell(
// onTap: () => Navigator.push(context, FadePage(page: WeightHomePage())),
// child: Container(
// margin: EdgeInsets.all(5),
// width: MediaQuery.of(context).size.width * 0.35,
// height: MediaQuery.of(context).size.width * 0.35,
// decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Image.asset(
// 'assets/tracker/weight.png',
// width: 60.0,
// ),
// SizedBox(
// height: 15,
// ),
// Texts(TranslationBase.of(context).weight),
// ],
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// ],
// ),
),
), ),
); );
} }

@ -725,10 +725,8 @@ class TranslationBase {
String get km => localizedValues['km'][locale.languageCode]; String get km => localizedValues['km'][locale.languageCode];
String get km_ => localizedValues['km_'][locale.languageCode]; String get km_ => localizedValues['km_'][locale.languageCode];
String get patientHealthSummaryReport => String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode];
localizedValues['PatientHealthSummaryReport'][locale.languageCode]; String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode];
String get toViewTheTermsAndConditions =>
localizedValues['ToViewTheTermsAndConditions'][locale.languageCode];
String get clickHere => localizedValues['ClickHere'][locale.languageCode]; String get clickHere => localizedValues['ClickHere'][locale.languageCode];
String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode];
@ -1069,14 +1067,10 @@ class TranslationBase {
String get consumed => localizedValues['consumed'][locale.languageCode]; String get consumed => localizedValues['consumed'][locale.languageCode];
String get transferred => localizedValues['transferred'][locale.languageCode]; String get transferred => localizedValues['transferred'][locale.languageCode];
String get checkBeneficiary => String get checkBeneficiary => localizedValues['checkBeneficiary'][locale.languageCode];
localizedValues['checkBeneficiary'][locale.languageCode]; String get beneficiaryName => localizedValues['beneficiaryName'][locale.languageCode];
String get beneficiaryName => String get accountActivation => localizedValues['accountActivation'][locale.languageCode];
localizedValues['beneficiaryName'][locale.languageCode]; String get nonRecommended => localizedValues['nonRecommended'][locale.languageCode];
String get accountActivation =>
localizedValues['accountActivation'][locale.languageCode];
String get nonRecommended =>
localizedValues['nonRecommended'][locale.languageCode];
String get lakumTransfer => localizedValues['lakumTransfer'][locale.languageCode]; String get lakumTransfer => localizedValues['lakumTransfer'][locale.languageCode];
@ -2142,26 +2136,20 @@ class TranslationBase {
String get aboutApp => localizedValues["about-app"][locale.languageCode]; String get aboutApp => localizedValues["about-app"][locale.languageCode];
String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode]; String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode];
String get timeNeeded => localizedValues["time-needed"][locale.languageCode]; String get timeNeeded => localizedValues["time-needed"][locale.languageCode];
String get totalTimeNeeded => String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode];
localizedValues["total-time-needed"][locale.languageCode]; String get infoEye => localizedValues["info-eye"][locale.languageCode];
String get infoEye => String get infoVaccines => localizedValues["info-vaccines"][locale.languageCode];
localizedValues["info-eye"][locale.languageCode]; String get infoTrackers => localizedValues["info-trackers"][locale.languageCode];
String get infoVaccines => String get infoHealthData => localizedValues["info-health-data"][locale.languageCode];
localizedValues["info-vaccines"][locale.languageCode]; String get infoAskDoc => localizedValues["info-ask-doc"][locale.languageCode];
String get infoTrackers => String get infoAutoWifi => localizedValues["info-auto-wifi"][locale.languageCode];
localizedValues["info-trackers"][locale.languageCode]; String get autoWifi => localizedValues["auto-wifi"][locale.languageCode];
String get infoHealthData => String get childVaccineInfo => localizedValues["child-vaccine-info"][locale.languageCode];
localizedValues["info-health-data"][locale.languageCode]; String get h2oInfo => localizedValues["h2o-info"][locale.languageCode];
String get infoAskDoc => String get sysdias => localizedValues["sys/dias"][locale.languageCode];
localizedValues["info-ask-doc"][locale.languageCode]; String get arm => localizedValues["arm"][locale.languageCode];
String get infoAutoWifi => String get removeMeasure => localizedValues["remove-measure"][locale.languageCode];
localizedValues["info-auto-wifi"][locale.languageCode]; String get selectArm => localizedValues["select-arm"][locale.languageCode];
String get autoWifi =>
localizedValues["auto-wifi"][locale.languageCode];
String get childVaccineInfo =>
localizedValues["child-vaccine-info"][locale.languageCode];
String get h2oInfo =>
localizedValues["h2o-info"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -10,12 +10,7 @@ class RadioStringDialog extends StatefulWidget {
final String title; final String title;
String selectedValue; String selectedValue;
RadioStringDialog( RadioStringDialog({Key key, this.radioList, this.onValueSelected, this.selectedValue, this.title});
{Key key,
this.radioList,
this.onValueSelected,
this.selectedValue,
this.title});
@override @override
_RadioStringDialogState createState() => _RadioStringDialogState(); _RadioStringDialogState createState() => _RadioStringDialogState();
@ -40,9 +35,7 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
))), ))),
children: [ children: [
Container( Container(
height: widget.radioList.length > 3 height: widget.radioList.length > 3 ? MediaQuery.of(context).size.height * 0.6 : null,
? MediaQuery.of(context).size.height * 0.6
: null,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
@ -52,9 +45,9 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( // SizedBox(
height: 2, // height: 2,
), // ),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -62,12 +55,14 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
widget.selectedValue = widget.selectedValue = widget.radioList[index];
widget.radioList[index];
}); });
}, },
child: ListTile( child: ListTile(
title: Text(widget.radioList[index]), title: Texts(
widget.radioList[index],
fontSize: 14,
),
leading: Radio( leading: Radio(
value: widget.radioList[index], value: widget.radioList[index],
groupValue: widget.selectedValue, groupValue: widget.selectedValue,
@ -83,66 +78,61 @@ class _RadioStringDialogState extends State<RadioStringDialog> {
) )
], ],
), ),
SizedBox(
height: 5.0,
),
], ],
), ),
), ),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
Row( ],
children: <Widget>[ ),
Expanded( ),
flex: 1, ),
child: InkWell( Row(
onTap: () { children: <Widget>[
Navigator.pop(context); Expanded(
}, flex: 1,
child: Padding( child: InkWell(
padding: const EdgeInsets.all(8.0), onTap: () {
child: Container( Navigator.pop(context);
child: Center( },
child: Texts( child: Padding(
TranslationBase.of(context) padding: const EdgeInsets.all(8.0),
.cancel child: Container(
.toUpperCase(), child: Center(
color: Colors.red, child: Texts(
), TranslationBase.of(context).cancel.toUpperCase(),
), color: Colors.red,
),
),
), ),
), ),
Container( ),
width: 1, ),
height: 30, ),
color: Colors.grey[500], ),
), Container(
Expanded( width: 1,
flex: 1, height: 30,
child: InkWell( color: Colors.grey[500],
onTap: () { ),
widget.onValueSelected(widget.selectedValue); Expanded(
Navigator.pop(context); flex: 1,
}, child: InkWell(
child: Padding( onTap: () {
padding: const EdgeInsets.all(8.0), widget.onValueSelected(widget.selectedValue);
child: Center( Navigator.pop(context);
child: Texts( },
TranslationBase.of(context).ok, child: Padding(
fontWeight: FontWeight.w400, padding: const EdgeInsets.all(8.0),
), child: Center(
), child: Texts(
), TranslationBase.of(context).ok,
), fontWeight: FontWeight.w400,
), ),
], ),
) ),
], ),
), ),
), ],
) )
], ],
); );

@ -113,12 +113,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
void initState() { void initState() {
controller = AnimationController(vsync: this, duration: Duration(seconds: 1)); controller = AnimationController(vsync: this, duration: Duration(seconds: 1));
offset = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller); offset = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller);
if (IS_VOICE_COMMAND_CLOSED == true) { if (IS_VOICE_COMMAND_CLOSED == true) {
controller.reverse(from: -1); controller.reverse(from: -1);
} else { } else {
if (mounted) { if (mounted) {
//Future.delayed(const Duration(seconds: 2), () { //Future.delayed(const Duration(seconds: 2), () {
_currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
setState(() { setState(() {
if (IS_TEXT_COMPLETED) { if (IS_TEXT_COMPLETED) {
isAnimationEnable = false; isAnimationEnable = false;
@ -222,13 +223,14 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
} }
startVoiceSearch() async { startVoiceSearch() async {
_currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
_currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
// listenMode: ListenMode.confirmation, //listenMode: ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA',
); );
} else { } else {
print("The user has denied the use of speech recognition."); print("The user has denied the use of speech recognition.");

Loading…
Cancel
Save