Merge branch 'development_new_design_2.0' into haroon-new-design

# Conflicts:
#	lib/pages/feedback/send_feedback_page.dart
merge-requests/427/head
haroon amjad 5 years ago
commit 230d87c473

@ -617,6 +617,7 @@ const Map localizedValues = {
"lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"}, "lakumTransfer": {"en": "Lakum Transfer", "ar": "تفعيل الحساب"},
"acceptLbl": {"en": "Accept", "ar": "موافقة"}, "acceptLbl": {"en": "Accept", "ar": "موافقة"},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"please_select_gender": {"en": "Please select gender", "ar": "يرجى تحديد الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},

@ -39,17 +39,9 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
TextEditingController _mobileTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController();
bool _isSubmitted = false; bool _isSubmitted = false;
dynamic _selectedCountry = { dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "+966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
SearchCriteriaModel selectedCriteria = SearchCriteriaModel( SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم المحول", value: 1);
name: "Identification Number", nameAr: "رقم المحول", value: 1);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -59,23 +51,15 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
Future.delayed(new Duration(milliseconds: 300)).then((value) async { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
SearchEReferralRequestModel searchEReferralRequestModel = SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
new SearchEReferralRequestModel( patientMobileNumber: (projectViewModel.user.outSA == 0 ? "966" : "971") + projectViewModel.user.mobileNumber.substring(1, projectViewModel.user.mobileNumber.length),
patientMobileNumber: (projectViewModel.user.outSA == 0
? "966"
: "971") +
projectViewModel.user.mobileNumber
.substring(1, projectViewModel.user.mobileNumber.length),
); );
if (selectedCriteria.value == 1) { if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo = searchEReferralRequestModel.identificationNo = _searchTextController.text;
_searchTextController.text;
searchEReferralRequestModel.referralNumber = 0; searchEReferralRequestModel.referralNumber = 0;
} else { } else {
searchEReferralRequestModel.referralNumber = searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
int.parse(_searchTextController.text); searchEReferralRequestModel.identificationNo = projectViewModel.user.patientIdentificationNo;
searchEReferralRequestModel.identificationNo =
projectViewModel.user.patientIdentificationNo;
} }
await model.getEReferrals(searchEReferralRequestModel); await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -102,15 +86,10 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)],
Texts(getSearchCriteriaName()),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
), ),
@ -118,9 +97,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: selectedCriteria.value == 1 hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number",
? "Enter Patient Identification No"
: "Enter Referral Number",
controller: _searchTextController, controller: _searchTextController,
onChanged: (_) { onChanged: (_) {
setState(() {}); setState(() {});
@ -135,15 +112,10 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
Texts(getCountryName()),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
), ),
@ -155,31 +127,21 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
onChange: (_) { onChange: (_) {
setState(() {}); setState(() {});
}, },
code: _selectedCountry == null code: _selectedCountry == null ? "11" : _selectedCountry["code"],
? "11"
: _selectedCountry["code"],
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if ((model.state == ViewState.Idle && if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)),
model.allReferral.length == 0)) if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error),
Center(
child: Text(
TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal))
AppEmbeddedError(error: model.error),
model.allReferral.length > 0 model.allReferral.length > 0
? NetworkBaseView( ? NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: ListView.separated( child: ListView.separated(
separatorBuilder: (context, index) => separatorBuilder: (context, index) => SizedBox(height: 0),
SizedBox(height: 0),
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemCount: model.allReferral == null itemCount: model.allReferral == null ? 0 : model.allReferral.length,
? 0
: model.allReferral.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -188,9 +150,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ReferralDetails( page: ReferralDetails(referral: model.allReferral[index]),
referral:
model.allReferral[index]),
), ),
); );
}, },
@ -200,71 +160,22 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Row( child: Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Text( Text(projectViewModel.isArabic ? model.allReferral[index].statusAr : model.allReferral[index].status,
projectViewModel.isArabic style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
? model
.allReferral[
index]
.statusAr
: model
.allReferral[
index]
.status,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
fontWeight:
FontWeight.bold)),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 5.0),
top: 5.0), child: myRichText(TranslationBase.of(context).patientName + ": ", model.allReferral[index].patientName, projectViewModel.isArabic)),
child: myRichText( myRichText(TranslationBase.of(context).hospital + ": ", model.allReferral[index].preferredBranchName, projectViewModel.isArabic),
TranslationBase.of( myRichText(TranslationBase.of(context).referralDate + ": ",
context) DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDateNoTimeZone(model.allReferral[index].referralDate)), projectViewModel.isArabic),
.patientName +
": ",
model
.allReferral[
index]
.patientName,
projectViewModel
.isArabic)),
myRichText(
TranslationBase.of(
context)
.hospital +
": ",
model.allReferral[index]
.preferredBranchName,
projectViewModel
.isArabic),
myRichText(
TranslationBase.of(
context)
.referralDate +
": ",
DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDateNoTimeZone(
model
.allReferral[
index]
.referralDate)),
projectViewModel
.isArabic),
], ],
), ),
Icon(projectViewModel.isArabic Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined),
? Icons
.arrow_back_ios_outlined
: Icons
.arrow_forward_ios_outlined),
], ],
), ),
), ),
@ -289,23 +200,17 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(14), padding: EdgeInsets.all(14),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).search, TranslationBase.of(context).search,
(_searchTextController.text.isEmpty || (_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty)
_mobileTextController.text.isEmpty)
? null ? null
: () async { : () async {
SearchEReferralRequestModel SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
searchEReferralRequestModel = patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text,
new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] +
_mobileTextController.text,
); );
if (selectedCriteria.value == 1) { if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo = searchEReferralRequestModel.identificationNo = _searchTextController.text;
_searchTextController.text;
searchEReferralRequestModel.referralNumber = 0; searchEReferralRequestModel.referralNumber = 0;
} else { } else {
searchEReferralRequestModel.referralNumber = searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = ''; searchEReferralRequestModel.identificationNo = '';
} }
await model.getEReferrals(searchEReferralRequestModel); await model.getEReferrals(searchEReferralRequestModel);

@ -8,6 +8,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/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -95,214 +96,318 @@ class _H2oSettingState extends State<H2oSetting> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).h2o, appBarTitle: TranslationBase.of(context).h2o,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
body: SingleChildScrollView( body: Column(
padding: EdgeInsets.fromLTRB(8, 8, 8, 80), children: [
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: SingleChildScrollView(
children: [ physics: BouncingScrollPhysics(),
TextField( padding: EdgeInsets.all(21),
controller: _nameController,
decoration: InputDecoration(
labelText: TranslationBase.of(context).enterNameHere,
labelStyle: TextStyle(color: Colors.black87),
fillColor: Colors.white,
filled: true,
border: UnderlineInputBorder(
borderSide: BorderSide(
width: 0,
style: BorderStyle.none,
),
borderRadius: BorderRadius.circular(6.0),
),
),
),
SizedBox(height: 8),
Text(TranslationBase.of(context).preferredunit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) {
if (_isUnitML != value) {
setState(() {
_isUnitML = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Text(TranslationBase.of(context).gender),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) {
if (_isGenderMale != value) {
setState(() {
_isGenderMale = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Text(TranslationBase.of(context).height),
_commonSlidersRow(_heightController, 1, 270, _heightValue, (text) {
_heightController.text = text;
}, (value) {
setState(() {
_heightValue = value;
});
}),
SizedBox(height: 8),
Text(TranslationBase.of(context).heightUnit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) {
if (_isHeightCM != value) {
setState(() {
_isHeightCM = value;
});
}
}),
SizedBox(height: 8),
_commonSlidersRow(_weightController, 1, 250, _weightValue, (text) {
_weightController.text = text;
}, (value) {
setState(() {
_weightValue = value;
});
}),
SizedBox(height: 8),
Text(TranslationBase.of(context).weightUnit),
SizedBox(height: 8),
_commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) {
if (_isWeightKG != value) {
setState(() {
_isWeightKG = value;
});
}
}),
Padding(
padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Divider(height: 1.5, color: Colors.black54),
),
Container(
padding: EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text("${TranslationBase.of(context).birth_date}:"), inputWidget(TranslationBase.of(context).enterNameHere, TranslationBase.of(context).enterNameHere, _nameController),
// TextField(
// controller: _nameController,
// decoration: InputDecoration(
// labelText: TranslationBase.of(context).enterNameHere,
// labelStyle: TextStyle(color: Colors.black87),
// fillColor: Colors.white,
// filled: true,
// border: UnderlineInputBorder(
// borderSide: BorderSide(
// width: 0,
// style: BorderStyle.none,
// ),
// borderRadius: BorderRadius.circular(6.0),
// ),
// ),
// ),
SizedBox(height: 16),
Text(
TranslationBase.of(context).preferredunit,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
SizedBox(height: 12),
_commonButtonsRow(TranslationBase.of(context).ml, TranslationBase.of(context).l, _isUnitML, (value) {
if (_isUnitML != value) {
setState(() {
_isUnitML = value;
});
}
}),
SizedBox(height: 12),
Text(
TranslationBase.of(context).pleaseSelectGender,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
SizedBox(height: 12),
_commonButtonsRow(TranslationBase.of(context).male, TranslationBase.of(context).female, _isGenderMale, (value) {
if (_isGenderMale != value) {
setState(() {
_isGenderMale = value;
});
}
}),
SizedBox(height: 12),
Text(TranslationBase.of(context).height),
_commonSlidersRow(_heightController, 1, 270, _heightValue, (text) {
_heightController.text = text;
}, (value) {
setState(() {
_heightValue = value;
});
}),
SizedBox(height: 8), SizedBox(height: 8),
InkWell( Text(TranslationBase.of(context).heightUnit),
onTap: () { SizedBox(height: 8),
showModalBottomSheet( _commonButtonsRow(TranslationBase.of(context).cm, TranslationBase.of(context).ft, _isHeightCM, (value) {
context: context, if (_isHeightCM != value) {
builder: (context) { setState(() {
return Container( _isHeightCM = value;
height: 250, });
padding: EdgeInsets.all(8), }
child: Column(children: [ }),
Container( SizedBox(height: 8),
height: 40, _commonSlidersRow(_weightController, 1, 250, _weightValue, (text) {
alignment: Alignment.centerRight, _weightController.text = text;
child: Row(mainAxisSize: MainAxisSize.min, children: [ }, (value) {
InkWell( setState(() {
onTap: () => Navigator.pop(context), _weightValue = value;
child: Container( });
alignment: Alignment.center, }),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), SizedBox(height: 8),
child: Text(TranslationBase.of(context).cancel), Text(TranslationBase.of(context).weightUnit),
), SizedBox(height: 8),
), _commonButtonsRow(TranslationBase.of(context).kg, TranslationBase.of(context).lb, _isWeightKG, (value) {
SizedBox(width: 8), if (_isWeightKG != value) {
InkWell( setState(() {
onTap: () { _isWeightKG = value;
Navigator.pop(context); });
setState(() { }
_dobDate = _tempDate; }),
}); Padding(
}, padding: EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Container( child: Divider(height: 1.5, color: Colors.black54),
alignment: Alignment.center, ),
padding: EdgeInsets.fromLTRB(8, 4, 8, 4), Container(
child: Text(TranslationBase.of(context).ok), padding: EdgeInsets.all(8),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("${TranslationBase.of(context).birth_date}:"),
SizedBox(height: 8),
InkWell(
onTap: () {
showModalBottomSheet(
context: context,
builder: (context) {
return Container(
height: 250,
padding: EdgeInsets.all(8),
child: Column(children: [
Container(
height: 40,
alignment: Alignment.centerRight,
child: Row(mainAxisSize: MainAxisSize.min, children: [
InkWell(
onTap: () => Navigator.pop(context),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
child: Text(TranslationBase.of(context).cancel),
),
),
SizedBox(width: 8),
InkWell(
onTap: () {
Navigator.pop(context);
setState(() {
_dobDate = _tempDate;
});
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
child: Text(TranslationBase.of(context).ok),
),
)
]),
), ),
) Expanded(
]), child: Container(
), width: MediaQuery.of(context).size.width,
Expanded( child: CupertinoDatePicker(
child: Container( initialDateTime: _dobDate,
width: MediaQuery.of(context).size.width, mode: CupertinoDatePickerMode.date,
child: CupertinoDatePicker( onDateTimeChanged: (_date) {
initialDateTime: _dobDate, _tempDate = _date;
mode: CupertinoDatePickerMode.date, },
onDateTimeChanged: (_date) { ),
_tempDate = _date; ),
}, )
), ]),
), );
) });
]), }, // implement cupertino dialog to select date
); child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]),
)
],
),
),
SizedBox(height: 8),
_commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _activityLevelListEng,
title: TranslationBase.of(context).activityLevel,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedActiveLevel = index + 1;
});
},
selectedIndex: _selectedActiveLevel - 1,
),
);
}),
SizedBox(height: 8),
_commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () {
showDialog(
context: context,
child: CommonRadioButtonDialog(
list: _remindedTimeListEng,
onSelect: (index) {
Navigator.pop(context);
setState(() {
_selectedRemindedTime = index;
}); });
}, // implement cupertino dialog to select date },
child: Row( selectedIndex: _selectedRemindedTime,
crossAxisAlignment: CrossAxisAlignment.center, ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, );
children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]), }),
) SizedBox(height: 16),
SizedBox(
height: 50,
width: MediaQuery.of(context).size.width,
child: FlatButton(
color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
onPressed: _updateUserDetails,
child: Text(
TranslationBase.of(context).save,
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600),
),
),
),
], ],
), ),
), ),
SizedBox(height: 8), ),
_commonDialogSelectorRow(TranslationBase.of(context).activityLevel, _activityLevelListEng[_selectedActiveLevel - 1], () { Container(
showDialog( color: Colors.white,
context: context, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: CommonRadioButtonDialog( child: DefaultButton(
list: _activityLevelListEng, TranslationBase.of(context).save,
title: TranslationBase.of(context).activityLevel, _updateUserDetails,
onSelect: (index) { color: Color(0xff349745),
Navigator.pop(context); ),
setState(() { ),
_selectedActiveLevel = index + 1; ],
}); ),
}, );
selectedIndex: _selectedActiveLevel - 1, }
),
); Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
}), return Container(
SizedBox(height: 8), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
_commonDialogSelectorRow(TranslationBase.of(context).reminderLabel, _remindedTimeListEng[_selectedRemindedTime], () { alignment: Alignment.center,
showDialog( decoration: BoxDecoration(
context: context, borderRadius: BorderRadius.circular(15),
child: CommonRadioButtonDialog( color: Colors.white,
list: _remindedTimeListEng, border: Border.all(
onSelect: (index) { color: Color(0xffefefef),
Navigator.pop(context); width: 1,
setState(() { ),
_selectedRemindedTime = index; ),
}); child: InkWell(
}, onTap: hasSelection ? () {} : null,
selectedIndex: _selectedRemindedTime, child: Row(
), children: [
); Expanded(
}), child: Column(
SizedBox(height: 16), mainAxisSize: MainAxisSize.min,
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 50, children: [
width: MediaQuery.of(context).size.width, Text(
child: FlatButton( _labelText,
color: Theme.of(context).appBarTheme.color, style: TextStyle(
shape: RoundedRectangleBorder( fontSize: 11,
borderRadius: BorderRadius.circular(8.0), fontWeight: FontWeight.w600,
), color: Color(0xff2B353E),
onPressed: _updateUserDetails, letterSpacing: -0.44,
child: Text( ),
TranslationBase.of(context).save, ),
style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w600), TextField(
), enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {
// validateForm()
},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
), ),
) ),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
], ],
), ),
), ),
@ -310,6 +415,16 @@ class _H2oSettingState extends State<H2oSetting> {
} }
Widget _commonButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) { Widget _commonButtonsRow(String rightText, String leftText, bool checkParam, Function(bool) callBack) {
return Row(
children: [
Row(children: [
Checkbox(value: null, onChanged: null)
],)
],
);
return Row(children: [ return Row(children: [
Expanded( Expanded(
child: SizedBox( child: SizedBox(

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
@ -13,11 +14,12 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; 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:provider/provider.dart';
class H2OPage extends StatefulWidget { class H2OPage extends StatefulWidget {
@override @override
@ -44,98 +46,121 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<H2OViewModel>( return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserDetail(), onModelReady: (model) => model.getUserDetail(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).waterTracker, appBarTitle: TranslationBase.of(context).waterTracker,
description: TranslationBase.of(context).h2oInfo, description: TranslationBase.of(context).h2oInfo,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
imagesInfo: [ imagesInfo: [
ImagesInfo( ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png')
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png')
], ],
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
baseViewModel: model, baseViewModel: model,
isHelp: true, isHelp: true,
appBarIcons: [ appBarIcons: [
model.isLogin if (model.isLogin)
? IconButton( IconButton(
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), icon: Icon(Icons.settings),
color: Colors.white, color: Color(0xff2B353E),
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), page: H2oSetting(userDetailModel: model.userDetail, viewModel: model),
),
);
},
)
: Container(),
],
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[
Positioned(
bottom: 1,
left: 0,
right: 0,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container(
color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
height: 70.0,
),
),
),
Center(
child: Container(
height: 60.0,
alignment: Alignment.center,
// margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.9,
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).today),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).week),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.28,
child: Center(
child: Texts(TranslationBase.of(context).month),
),
),
],
),
), ),
), );
], },
), ),
), ],
backgroundColor: Colors.white, body: Scaffold(
// extendBodyBehindAppBar: true,
// appBar: PreferredSize(
// preferredSize: Size.fromHeight(65.0),
// child: Stack(
// children: <Widget>[
// Positioned(
// bottom: 1,
// left: 0,
// right: 0,
// child: BackdropFilter(
// filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
// child: Container(
// color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
// height: 70.0,
// ),
// ),
// ),
// Center(
// child: Container(
// height: 60.0,
// alignment: Alignment.center,
// // margin: EdgeInsets.only(top: 10.0),
// // width: MediaQuery.of(context).size.width * 0.9,
//
// child: TabBar(
// isScrollable: false,
// controller: _tabController,
// indicatorWeight: 5.0,
// indicatorSize: TabBarIndicatorSize.tab,
// indicatorColor: Colors.red[800],
// labelColor: Theme.of(context).primaryColor,
// labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
// unselectedLabelColor: Colors.grey[800],
// tabs: [
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).today),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).week),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).month),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// backgroundColor: Colors.white,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)],
),
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),

@ -25,145 +25,144 @@ class TodayPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).h2o, appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12), padding: EdgeInsets.all(21),
child: Container( child: Column(
margin: EdgeInsets.only(top: 60), children: [
child: Column(
children: [
Center(
child: CircularPercentIndicator(
radius: 180.0,
animation: true,
animationDuration: 1200,
lineWidth: 15.0,
percent: model.userProgressData == null
? 0.0
: (model.userProgressData.percentageConsumed / 100) >= 1
? 1
: (model.userProgressData.percentageConsumed / 100),
center: Center(
child: FutureBuilder<bool>(
future: readPrefs(),
builder: (context, data) {
var isUnitML = true;
String unit;
if (data.connectionState == ConnectionState.done) {
isUnitML = data.data;
}
if (isUnitML) {
unit = TranslationBase.of(context).ml;
} else {
unit = TranslationBase.of(context).l;
}
unit = unit.toLowerCase();
var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0;
var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0;
if (!isUnitML) {
totalH2O = totalH2O / 1000;
consumedH2O = consumedH2O / 1000;
}
var remainingH2O = totalH2O - consumedH2O;
return Column(
mainAxisSize: MainAxisSize.min, Center(
children: [ child: CircularPercentIndicator(
// SizedBox( radius: 180.0,
// height: 40, animation: true,
// ), animationDuration: 1200,
Text( lineWidth: 15.0,
TranslationBase.of(context).consumed, percent: model.userProgressData == null
style: TextStyle(fontSize: 16.0), ? 0.0
), : (model.userProgressData.percentageConsumed / 100) >= 1
SizedBox( ? 1
height: 4, : (model.userProgressData.percentageConsumed / 100),
), center: Center(
Text( child: FutureBuilder<bool>(
model.userProgressData == null ? "0.0" : "$consumedH2O $unit", future: readPrefs(),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")), builder: (context, data) {
), var isUnitML = true;
SizedBox( String unit;
height: 4, if (data.connectionState == ConnectionState.done) {
), isUnitML = data.data;
SizedBox( }
height: 5, if (isUnitML) {
width: 50, unit = TranslationBase.of(context).ml;
child: Container(), } else {
), unit = TranslationBase.of(context).l;
SizedBox( }
height: 4, unit = unit.toLowerCase();
), var totalH2O = model?.userProgressData?.quantityLimit ?? 0.0;
Text( var consumedH2O = model?.userProgressData?.quantityConsumed ?? 0.0;
TranslationBase.of(context).remaining, if (!isUnitML) {
style: TextStyle(fontSize: 16.0), totalH2O = totalH2O / 1000;
), consumedH2O = consumedH2O / 1000;
SizedBox( }
height: 4, var remainingH2O = totalH2O - consumedH2O;
),
Text( return Column(
model.userProgressData == null mainAxisSize: MainAxisSize.min,
? "0.0" children: [
: (remainingH2O) < 0 // SizedBox(
? "0 $unit" // height: 40,
: '$remainingH2O $unit', // ),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0), Text(
), TranslationBase.of(context).consumed,
], style: TextStyle(fontSize: 16.0),
); ),
}, SizedBox(
), height: 4,
),
Text(
model.userProgressData == null ? "0.0" : "$consumedH2O $unit",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0, color: HexColor("#60BCF9")),
),
SizedBox(
height: 4,
),
SizedBox(
height: 5,
width: 50,
child: Container(),
),
SizedBox(
height: 4,
),
Text(
TranslationBase.of(context).remaining,
style: TextStyle(fontSize: 16.0),
),
SizedBox(
height: 4,
),
Text(
model.userProgressData == null
? "0.0"
: (remainingH2O) < 0
? "0 $unit"
: '$remainingH2O $unit',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14.0),
),
],
);
},
), ),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: HexColor("#D1E3F6"),
progressColor: HexColor("#60BCF9"),
), ),
circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: HexColor("#D1E3F6"),
progressColor: HexColor("#60BCF9"),
), ),
Row( ),
mainAxisAlignment: MainAxisAlignment.spaceAround, Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceAround,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.center, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Container( children: [
margin: EdgeInsets.only(bottom: 16), Container(
height: 30, margin: EdgeInsets.only(bottom: 16),
width: 70, height: 30,
decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))), width: 70,
), decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
Text( ),
"${TranslationBase.of(context).remaining} %", Text(
style: TextStyle(fontSize: 16.0), "${TranslationBase.of(context).remaining} %",
) style: TextStyle(fontSize: 16.0),
], )
), ],
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"${TranslationBase.of(context).consumed} %",
style: TextStyle(fontSize: 16.0),
)
],
)
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 0.5,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey,
), ),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#60BCF9"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"${TranslationBase.of(context).consumed} %",
style: TextStyle(fontSize: 16.0),
)
],
)
],
),
SizedBox(
height: 30,
),
SizedBox(
height: 0.5,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey,
), ),
], ),
), ],
), ),
), ),
floatingActionButton: H20FloatingActionButton( floatingActionButton: H20FloatingActionButton(

@ -74,7 +74,7 @@ class DoctorView extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic), if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic),
if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName, projectViewModel.isArabic), if (doctor.projectName != null) myRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null) if (doctor.speciality != null)
Text( Text(
getDoctorSpeciality(this.doctor.speciality).trim(), getDoctorSpeciality(this.doctor.speciality).trim(),

@ -91,7 +91,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
), ),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
color: tappedIndex == index ? Colors.white : Colors.black, color: tappedIndex == index ? Colors.white : Colors.black,
), ),
], ],

@ -167,7 +167,7 @@ class _SchedulePageState extends State<SchedulePage> {
? Icons ? Icons
.arrow_back_ios_outlined .arrow_back_ios_outlined
: Icons : Icons
.arrow_forward_ios_outlined, size: 16.0), .arrow_forward_outlined, size: 16.0),
], ],
) )
]))), ]))),

@ -74,7 +74,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
.prescriptionReportEnhList[index].itemDescription)), .prescriptionReportEnhList[index].itemDescription)),
)), )),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
size: 18, size: 18,
color: Colors.grey[500], color: Colors.grey[500],
) )

@ -99,7 +99,7 @@ class DoctorResponse extends StatelessWidget {
), ),
), ),
Icon(projectViewModel.isArabic Icon(projectViewModel.isArabic
? Icons.arrow_forward_ios ? Icons.arrow_forward
: Icons.arrow_back_ios) : Icons.arrow_back_ios)
], ],
), ),
@ -169,7 +169,7 @@ class DoctorResponse extends StatelessWidget {
), ),
), ),
Icon(projectViewModel.isArabic Icon(projectViewModel.isArabic
? Icons.arrow_forward_ios ? Icons.arrow_forward
: Icons.arrow_back_ios) : Icons.arrow_back_ios)
], ],
), ),

@ -23,6 +23,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
final AddressInfo selectedAddress; final AddressInfo selectedAddress;
final double latitude; final double latitude;
final double longitude; final double longitude;
PrescriptionOrderOverview({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude}); PrescriptionOrderOverview({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude});
@override @override
@ -43,83 +44,109 @@ class PrescriptionOrderOverview extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
if (!prescriptions.isInOutPatient) if (!prescriptions.isInOutPatient)
...List.generate( Card(
prescriptionReportList.length, margin: EdgeInsets.all(12),
(index) => Container( shape: cardRadius(12),
width: double.infinity, clipBehavior: Clip.antiAlias,
margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: Padding(
padding: EdgeInsets.all(8.0), padding: const EdgeInsets.all(12.0),
decoration: BoxDecoration( child: Column(
color: Colors.white, children: [
borderRadius: BorderRadius.all( ...List.generate(
Radius.circular(10.0), prescriptionReportList.length,
), (index) => Card(
border: Border.all(color: Colors.grey[200], width: 0.5), margin: EdgeInsets.all(0.0),
), color: Colors.white,
child: Row( shape: cardRadius(0),
children: <Widget>[ elevation: 0,
ClipRRect( child: Row(
borderRadius: BorderRadius.all(Radius.circular(5)), children: <Widget>[
child: Image.network( ClipRRect(
prescriptionReportList[index].imageSRCUrl, borderRadius: BorderRadius.all(Radius.circular(5)),
fit: BoxFit.cover, child: Image.network(
width: 60, prescriptionReportList[index].imageSRCUrl,
height: 70, fit: BoxFit.cover,
), width: 60,
), height: 70,
SizedBox( ),
width: 10, ),
), SizedBox(
Expanded( width: 10,
child: Padding( ),
padding: const EdgeInsets.all(8.0), Expanded(
child: Center( child: Padding(
child: Texts( padding: const EdgeInsets.all(8.0),
prescriptionReportList[index].itemDescription.isNotEmpty ? prescriptionReportList[index].itemDescription : prescriptionReportList[index].itemDescriptionN)), child: Center(
)), child: Texts(prescriptionReportList[index].itemDescription.isNotEmpty
? prescriptionReportList[index].itemDescription
], : prescriptionReportList[index].itemDescriptionN)),
), )),
)) ],
),
))
],
),
),
)
else else
...List.generate( Card(
prescriptionReportEnhList.length, margin: EdgeInsets.all(12),
(index) => Card( shape: cardRadius(12),
margin: EdgeInsets.all(12.0), clipBehavior: Clip.antiAlias,
color: Colors.white, child: Padding(
shape: cardRadius(12), padding: const EdgeInsets.all(12.0),
elevation: 4, child: Column(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
Padding( Text(
padding: const EdgeInsets.all(8.0), TranslationBase.of(context).invoiceNo + ": " + prescriptions.patientID.toString(),
child: ClipRRect( style: TextStyle(
borderRadius: BorderRadius.all(Radius.circular(5)), fontSize: 16,
child: Image.network( fontWeight: FontWeight.bold,
prescriptionReportEnhList[index].imageSRCUrl, color: Colors.black,
fit: BoxFit.cover, letterSpacing: -0.46,
width: 60,
height: 60,
),
), ),
), ),
...List.generate(
Expanded( prescriptionReportEnhList.length,
child: Padding( (index) => Card(
padding: const EdgeInsets.all(8.0), margin: EdgeInsets.all(0.0),
child: Column( color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start, shape: cardRadius(0),
elevation: 0,
child: Row(
children: <Widget>[ children: <Widget>[
Texts(prescriptionReportEnhList[index].itemDescription), Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 60,
),
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(prescriptionReportEnhList[index].itemDescription),
],
),
),
),
], ],
), ),
), ),
), )
], ],
), ),
), ),
) ),
], ],
), ),
), ),
@ -143,12 +170,12 @@ class PrescriptionOrderOverview extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model await model
.insertDeliveryOrder( .insertDeliveryOrder(
lineItemNo: 0, lineItemNo: 0,
longitude: longitude, longitude: longitude,
latitude: latitude, latitude: latitude,
appointmentNo: prescriptions.appointmentNo, appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo, dischargeID: prescriptions.dischargeNo,
createdBy: model.user.patientID) createdBy: model.user.patientID)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) if (model.state == ViewState.ErrorLocal)
@ -170,7 +197,6 @@ class PrescriptionOrderOverview extends StatelessWidget {
], ],
), ),
), ),
), ),
); );
} }

@ -187,7 +187,7 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
size: 16, size: 16,
), ),
], ],
@ -307,7 +307,7 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
size: 16, size: 16,
), ),
], ],

@ -133,7 +133,7 @@ class PrescriptionsHistoryPage extends StatelessWidget {
), ),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
size: 16, size: 16,
), ),
mWidth(6), mWidth(6),

@ -45,6 +45,8 @@ class PrescriptionsPage extends StatelessWidget {
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
Prescriptions prescriptions = prescriptionsList[_index]; Prescriptions prescriptions = prescriptionsList[_index];
bool _isSortByClinic = filterType == FilterType.Clinic;
return DoctorCard( return DoctorCard(
onTap: () async { onTap: () async {
final _shouldRecallApi = await Navigator.push( final _shouldRecallApi = await Navigator.push(
@ -63,6 +65,7 @@ class PrescriptionsPage extends StatelessWidget {
profileUrl: prescriptions.doctorImageURL, profileUrl: prescriptions.doctorImageURL,
rating: prescriptions.actualDoctorRate.toDouble(), rating: prescriptions.actualDoctorRate.toDouble(),
subName: prescriptions.name, subName: prescriptions.name,
isSortByClinic: _isSortByClinic,
isInOutPatient: prescriptions.isInOutPatient, isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment, isLiveCareAppointment: prescriptions.isLiveCareAppointment,
// appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions // appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions

@ -330,7 +330,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
), ),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
size: 20, size: 20,
color: Colors.grey.shade400, color: Colors.grey.shade400,
), ),
@ -537,7 +537,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
), ),
), ),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward,
size: 20, size: 20,
color: Colors.grey.shade400, color: Colors.grey.shade400,
), ),

@ -60,7 +60,7 @@ class _MyVaccinesItemPageState extends State<MyVaccinesItemPage> {
child: Texts( child: Texts(
model.vaccinationItemList[index].dESCRIPTION)), model.vaccinationItemList[index].dESCRIPTION)),
Icon(projectViewModel.isArabic Icon(projectViewModel.isArabic
? Icons.arrow_forward_ios ? Icons.arrow_forward
: Icons.arrow_back_ios) : Icons.arrow_back_ios)
], ],
), ),

@ -86,6 +86,8 @@ class TranslationBase {
String get gender => localizedValues['gender'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode];
String get pleaseSelectGender => localizedValues['please_select_gender'][locale.languageCode];
String get nationality => localizedValues['nationality'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode];
String get docQualifications => localizedValues['docQualifications'][locale.languageCode]; String get docQualifications => localizedValues['docQualifications'][locale.languageCode];

@ -0,0 +1,287 @@
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import '../../Constants.dart';
class ShowChart extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries;
final int indexes;
final double horizontalInterval;
ShowChart({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 20.0});
List<int> xAxixs = List();
List<double> yAxixs = List();
@override
Widget build(BuildContext context) {
getXaxix();
getYaxix();
return AspectRatio(
aspectRatio: 1.0,
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)),
// color: Colors.white,
),
child: Stack(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(
height: 4,
),
Text(
title,
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
SizedBox(
height: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
),
),
),
const SizedBox(
height: 10,
),
],
),
],
),
),
);
}
getXaxix() {
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries.length) {
xAxixs.add(mIndex);
}
}
}
getYaxix() {
int indexess = (timeSeries.length * 0.30).toInt();
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexess * index;
if (mIndex < timeSeries.length) {
yAxixs.add(timeSeries[mIndex].sales);
}
}
}
// LineChartData sampleData1(context) {
// return LineChartData(
// lineTouchData: LineTouchData(
// touchTooltipData: LineTouchTooltipData(
// tooltipBgColor: Colors.white,
// ),
// touchCallback: (LineTouchResponse touchResponse) {},
// handleBuiltInTouches: true,
// ),
// gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
// titlesData: FlTitlesData(
// bottomTitles: SideTitles(
// showTitles: true,
// getTextStyles: (value) => const TextStyle(
// color: Colors.black,
// fontSize: 10,
// ),
// // rotateAngle: 90,
// //rotateAngle:-65,
// margin: 22,
// getTitles: (value) {
// if (timeSeries.length < 15) {
// if (timeSeries.length > value.toInt()) {
// return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// } else
// return '';
// } else {
// if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// if (xAxixs.contains(value.toInt())) {
// return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
// }
// }
// return '';
// },
// ),
// leftTitles: SideTitles(
// showTitles: true,
// // interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
// interval: 3,
// getTextStyles: (value) => const TextStyle(
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 10,
// ),
//
// margin: 12,
// ),
// ),
// borderData: FlBorderData(
// show: true,
// border: const Border(
// bottom: BorderSide(
// color: Colors.black,
// width: 0.5,
// ),
// left: BorderSide(
// color: Colors.black,
// ),
// right: BorderSide(
// color: Colors.black,
// ),
// top: BorderSide(
// color: Colors.transparent,
// ),
// ),
// ),
// minX: 0,
// maxX: (timeSeries.length - 1).toDouble(),
// maxY: getMaxY() + 0.3,
// minY: 0,
// //getMinY(),
// lineBarsData: getData(context),
// );
// }
LineChartData sampleData1(context) {
return LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontSize: 10,
),
rotateAngle: -65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
}
}
return '';
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval: 3.0,
// interval: getMaxY() - getMinY() <= 500
// ? getMaxY() - getMinY() <= 50
// ? 10
// : 10
// : getMaxY() - getMinY() <= 1000
// ? 100
// : getMaxY() - getMinY() >= 10000
// ? 5000
// : 200,
margin: 12,
),
),
borderData: FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(
color: Colors.black,
width: 0.5,
),
left: BorderSide(
color: Colors.black,
),
right: BorderSide(
color: Colors.black,
),
top: BorderSide(
color: Colors.transparent,
),
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: 0,
//getMinY(),
lineBarsData: getData(context),
);
}
double getMaxY() {
double max = 0;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
return max.roundToDouble();
}
double getMinY() {
double min = timeSeries.isEmpty ? 0 : timeSeries.first.sales;
timeSeries.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
int value = min.toInt();
return value.toDouble();
}
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [secondaryColor],
barWidth: 1.5,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,
),
belowBarData: BarAreaData(
show: false,
),
);
return [
lineChartBarData1,
];
}
}

@ -164,7 +164,7 @@ class DoctorCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic), myRichText(isSortByClinic ? TranslationBase.of(context).branch : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

@ -114,7 +114,7 @@ class AppScaffold extends StatelessWidget {
dropdownIndexValue: dropdownIndexValue, dropdownIndexValue: dropdownIndexValue,
dropDownList: dropDownList ?? [], dropDownList: dropDownList ?? [],
dropDownIndexChange: dropDownIndexChange, dropDownIndexChange: dropDownIndexChange,
) appBarIcons: appBarIcons)
: (isShowAppBar : (isShowAppBar
? appBar = AppBarWidget( ? appBar = AppBarWidget(
appBarTitle: appBarTitle, appBarTitle: appBarTitle,
@ -166,7 +166,9 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final int dropdownIndexValue; final int dropdownIndexValue;
List<String> dropDownList; List<String> dropDownList;
final Function(int) dropDownIndexChange; final Function(int) dropDownIndexChange;
NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.dropdownIndexValue, this.dropDownIndexChange}) : super(key: key); final List<Widget> appBarIcons;
NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -224,9 +226,12 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
), ),
), ),
), ),
) ),
], ],
), ),
actions: <Widget>[
if (appBarIcons != null) ...appBarIcons,
],
); );
} }

Loading…
Cancel
Save