Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan_new_design

merge-update-with-lab-changes
Sultan Khan 4 years ago
commit 821a9b5ade

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="612px" height="612px" viewBox="0 0 612 612" style="enable-background:new 0 0 612 612;" xml:space="preserve">
<g>
<g id="_x32__22_">
<g>
<path d="M535.5,0h-459C34.253,0,0,34.253,0,76.5v459C0,577.747,34.253,612,76.5,612h459c42.247,0,76.5-34.253,76.5-76.5v-459
C612,34.253,577.747,0,535.5,0z M229.5,459c10.557,0,19.125,8.568,19.125,19.125s-8.568,19.125-19.125,19.125h-95.089
c-5.355,0-10.156-2.219-13.617-5.757c-3.71-3.137-6.043-7.707-6.043-13.368V382.5c0-10.557,8.568-19.125,19.125-19.125
S153,371.943,153,382.5l-0.421,49.075l91.379-91.38l27.043,27.043L179.239,459H229.5z M243.958,271.824l-91.379-91.398L153,229.5
c0,10.557-8.568,19.125-19.125,19.125s-19.125-8.568-19.125-19.125v-95.625c0-5.661,2.333-10.232,6.043-13.388
c3.461-3.519,8.281-5.737,13.617-5.737H229.5c10.557,0,19.125,8.568,19.125,19.125S240.057,153,229.5,153h-50.261l91.781,91.781
L243.958,271.824z M497.25,478.125c0,5.661-2.333,10.231-6.044,13.388c-3.461,3.538-8.28,5.737-13.616,5.737H382.5
c-10.557,0-19.125-8.568-19.125-19.125S371.943,459,382.5,459h50.261l-91.781-91.781l27.043-27.042l91.379,91.379L459,382.5
c0-10.557,8.568-19.125,19.125-19.125s19.125,8.568,19.125,19.125V478.125z M497.25,229.5c0,10.557-8.568,19.125-19.125,19.125
S459,240.057,459,229.5l0.421-49.075l-91.38,91.379l-27.042-27.043L432.761,153H382.5c-10.557,0-19.125-8.568-19.125-19.125
s8.568-19.125,19.125-19.125h95.09c5.336,0,10.155,2.219,13.616,5.757c3.711,3.136,6.044,7.707,6.044,13.368V229.5z"/>
</g>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

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

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/photo_view_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'new_cmc_step_tow_page.dart';
@ -124,10 +125,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
),
margin: EdgeInsets.all(12),
child: IconButton(
icon: Icon(
Icons.view_carousel_rounded,
color: Colors.white,
),
icon: SvgPicture.asset("assets/images/new/ic_zoom.svg",color: Colors.white,),
padding: EdgeInsets.all(12),
onPressed: () {
showDraggableDialog(context, PhotoViewPage(projectViewModel.isArabic ? "assets/images/cc_ar.png" : "assets/images/cc_en.png"));
},

@ -39,17 +39,9 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
TextEditingController _mobileTextController = TextEditingController();
bool _isSubmitted = false;
dynamic _selectedCountry = {
"name": "Saudi Arabia",
"name_ar": "المملكة العربية السعودية",
"code": "+966",
"countryCode": "SA",
"pattern": "5xxxxxxxx",
"maxLength": 9
};
dynamic _selectedCountry = {"name": "Saudi Arabia", "name_ar": "المملكة العربية السعودية", "code": "+966", "countryCode": "SA", "pattern": "5xxxxxxxx", "maxLength": 9};
SearchCriteriaModel selectedCriteria = SearchCriteriaModel(
name: "Identification Number", nameAr: "رقم المحول", value: 1);
SearchCriteriaModel selectedCriteria = SearchCriteriaModel(name: "Identification Number", nameAr: "رقم المحول", value: 1);
@override
Widget build(BuildContext context) {
@ -59,23 +51,15 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
if (projectViewModel.isLogin) {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
SearchEReferralRequestModel searchEReferralRequestModel =
new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0
? "966"
: "971") +
projectViewModel.user.mobileNumber
.substring(1, projectViewModel.user.mobileNumber.length),
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: (projectViewModel.user.outSA == 0 ? "966" : "971") + projectViewModel.user.mobileNumber.substring(1, projectViewModel.user.mobileNumber.length),
);
if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo =
_searchTextController.text;
searchEReferralRequestModel.identificationNo = _searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber =
int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo =
projectViewModel.user.patientIdentificationNo;
searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = projectViewModel.user.patientIdentificationNo;
}
await model.getEReferrals(searchEReferralRequestModel);
GifLoaderDialogUtils.hideDialog(context);
@ -102,15 +86,10 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSearchCriteriaName()),
Icon(Icons.arrow_drop_down)
],
children: [Texts(getSearchCriteriaName()), Icon(Icons.arrow_drop_down)],
),
),
),
@ -118,9 +97,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
height: 12,
),
NewTextFields(
hintText: selectedCriteria.value == 1
? "Enter Patient Identification No"
: "Enter Referral Number",
hintText: selectedCriteria.value == 1 ? "Enter Patient Identification No" : "Enter Referral Number",
controller: _searchTextController,
onChanged: (_) {
setState(() {});
@ -135,15 +112,10 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getCountryName()),
Icon(Icons.arrow_drop_down)
],
children: [Texts(getCountryName()), Icon(Icons.arrow_drop_down)],
),
),
),
@ -155,31 +127,21 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
onChange: (_) {
setState(() {});
},
code: _selectedCountry == null
? "11"
: _selectedCountry["code"],
code: _selectedCountry == null ? "11" : _selectedCountry["code"],
),
SizedBox(
height: 12,
),
if ((model.state == ViewState.Idle &&
model.allReferral.length == 0))
Center(
child: Text(
TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal))
AppEmbeddedError(error: model.error),
if ((model.state == ViewState.Idle && model.allReferral.length == 0)) Center(child: Text(TranslationBase.of(context).noSearchResult)),
if ((model.state == ViewState.ErrorLocal)) AppEmbeddedError(error: model.error),
model.allReferral.length > 0
? NetworkBaseView(
baseViewModel: model,
child: ListView.separated(
separatorBuilder: (context, index) =>
SizedBox(height: 0),
separatorBuilder: (context, index) => SizedBox(height: 0),
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: model.allReferral == null
? 0
: model.allReferral.length,
itemCount: model.allReferral == null ? 0 : model.allReferral.length,
itemBuilder: (BuildContext context, int index) {
return Container(
width: double.infinity,
@ -188,9 +150,7 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
Navigator.push(
context,
FadePage(
page: ReferralDetails(
referral:
model.allReferral[index]),
page: ReferralDetails(referral: model.allReferral[index]),
),
);
},
@ -200,71 +160,22 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
projectViewModel.isArabic
? model
.allReferral[
index]
.statusAr
: model
.allReferral[
index]
.status,
style: TextStyle(
fontSize: 14.0,
letterSpacing: -0.56,
fontWeight:
FontWeight.bold)),
Text(projectViewModel.isArabic ? model.allReferral[index].statusAr : model.allReferral[index].status,
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(
top: 5.0),
child: myRichText(
TranslationBase.of(
context)
.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),
margin: EdgeInsets.only(top: 5.0),
child: myRichText(TranslationBase.of(context).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
? Icons
.arrow_back_ios_outlined
: Icons
.arrow_forward_ios_outlined),
Icon(projectViewModel.isArabic ? Icons.arrow_back_ios_outlined : Icons.arrow_forward_outlined),
],
),
),
@ -289,23 +200,17 @@ class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
padding: EdgeInsets.all(14),
child: DefaultButton(
TranslationBase.of(context).search,
(_searchTextController.text.isEmpty ||
_mobileTextController.text.isEmpty)
(_searchTextController.text.isEmpty || _mobileTextController.text.isEmpty)
? null
: () async {
SearchEReferralRequestModel
searchEReferralRequestModel =
new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] +
_mobileTextController.text,
SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel(
patientMobileNumber: _selectedCountry['code'] + _mobileTextController.text,
);
if (selectedCriteria.value == 1) {
searchEReferralRequestModel.identificationNo =
_searchTextController.text;
searchEReferralRequestModel.identificationNo = _searchTextController.text;
searchEReferralRequestModel.referralNumber = 0;
} else {
searchEReferralRequestModel.referralNumber =
int.parse(_searchTextController.text);
searchEReferralRequestModel.referralNumber = int.parse(_searchTextController.text);
searchEReferralRequestModel.identificationNo = '';
}
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/gif_loader_dialog_utils.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -95,214 +96,318 @@ class _H2oSettingState extends State<H2oSetting> {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).h2o,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
showHomeAppBarIcon: false,
body: SingleChildScrollView(
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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: 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),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
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),
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(
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,
child: CupertinoDatePicker(
initialDateTime: _dobDate,
mode: CupertinoDatePickerMode.date,
onDateTimeChanged: (_date) {
_tempDate = _date;
},
),
),
)
]),
);
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: CupertinoDatePicker(
initialDateTime: _dobDate,
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(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(DateUtil.getFormattedDate(_dobDate, "yyyy-MM-dd")), Icon(Icons.arrow_drop_down_outlined)]),
)
},
selectedIndex: _selectedRemindedTime,
),
);
}),
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], () {
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;
});
},
selectedIndex: _selectedRemindedTime,
),
);
}),
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),
),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).save,
_updateUserDetails,
color: Color(0xff349745),
),
),
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
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) {
return Row(
children: [
Row(children: [
Checkbox(value: null, onChanged: null)
],)
],
);
return Row(children: [
Expanded(
child: SizedBox(

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.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/month_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/uitl/translations_delegate_base.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/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class H2OPage extends StatefulWidget {
@override
@ -44,98 +46,121 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserDetail(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).waterTracker,
description: TranslationBase.of(context).h2oInfo,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
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')
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')
],
showHomeAppBarIcon: false,
baseViewModel: model,
isHelp: true,
appBarIcons: [
model.isLogin
? IconButton(
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
FadePage(
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),
),
),
],
),
if (model.isLogin)
IconButton(
icon: Icon(Icons.settings),
color: Color(0xff2B353E),
onPressed: () {
Navigator.push(
context,
FadePage(
page: H2oSetting(userDetailModel: model.userDetail, viewModel: model),
),
),
],
);
},
),
),
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(
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(
child: TabBarView(
physics: BouncingScrollPhysics(),

@ -25,145 +25,144 @@ class TodayPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).h2o,
baseViewModel: model,
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12),
child: Container(
margin: EdgeInsets.only(top: 60),
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;
padding: EdgeInsets.all(21),
child: Column(
children: [
return Column(
mainAxisSize: MainAxisSize.min,
children: [
// SizedBox(
// height: 40,
// ),
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),
),
],
);
},
),
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,
children: [
// SizedBox(
// height: 40,
// ),
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,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"${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,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(bottom: 16),
height: 30,
width: 70,
decoration: BoxDecoration(color: HexColor("#D1E3F6"), borderRadius: BorderRadius.all(Radius.circular(30))),
),
Text(
"${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,
),
],
),
),
],
),
),
floatingActionButton: H20FloatingActionButton(

@ -74,7 +74,7 @@ class DoctorView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
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)
Text(
getDoctorSpeciality(this.doctor.speciality).trim(),

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

@ -145,6 +145,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
itemBuilder: (ctx, idx) {
var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
print("dddddddddddddd " + obj["ans"].toString());
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
@ -170,6 +171,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
checkAllChecked();
});
}),
Text(
@ -192,6 +194,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
checkAllChecked();
});
}),
Text(
@ -228,7 +231,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
child: MaterialButton(
height: 50,
elevation: 0,
color: CustomColors.accentColor,
color: all2 ? CustomColors.accentColor : CustomColors.grey,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
@ -249,6 +252,17 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
));
}
bool all2 = false;
checkAllChecked() {
all2 = true;
qa.forEach((element) {
if (element["ans"] == 2 || element["ans"] == null) {
all2 = false;
}
});
}
next() async {
bool all = true;
qa.forEach((element) {

@ -117,6 +117,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
onTap: () {
setState(() {
widget.selectedProcedure = widget.proceduresList[index];
getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
});
},
child: ListTile(

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -251,7 +252,16 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (isPaymentMade) checkPaymentStatus(appo);
if (isPaymentMade) {
checkPaymentStatus(appo);
} else {
print("onBrowserExit Payment Not made");
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
}
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {

@ -167,7 +167,7 @@ class _SchedulePageState extends State<SchedulePage> {
? Icons
.arrow_back_ios_outlined
: 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)),
)),
Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 18,
color: Colors.grey[500],
)

@ -240,7 +240,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
flex: 1,
child: Center(
child: Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 15,
),
),
@ -314,7 +314,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
flex: 1,
child: Center(
child: Icon(
Icons.arrow_forward_ios,
Icons.arrow_forward,
size: 15,
),
),

@ -137,19 +137,20 @@ class LoggedSliderView extends StatelessWidget {
padding: const EdgeInsets.only(left: 20, right: 20),
child: Row(
children: <Widget>[
Expanded( flex: 3,
Expanded(
flex: 3,
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/height.svg',
width: 12,
height: 12,
width: 11,
height: 11,
),
mWidth(6),
Texts(
"${TranslationBase.of(context).height}: ${model.heightCm} ${TranslationBase.of(context).cm}",
color: Colors.white,
fontSize: 10,
fontSize: 8,
)
],
),
@ -157,16 +158,21 @@ class LoggedSliderView extends StatelessWidget {
SizedBox(
width: 3,
),
Expanded( flex: 3,
Expanded(
flex: 3,
child: Row(
children: <Widget>[
SvgPicture.asset(
'assets/images/new/weight.svg',
width: 12,
height: 12,
width: 11,
height: 11,
),
mWidth(6),
Texts('${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10)
Texts(
'${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}',
color: Colors.white,
fontSize: 8,
)
],
),
),
@ -179,11 +185,15 @@ class LoggedSliderView extends StatelessWidget {
children: <Widget>[
SvgPicture.asset(
'assets/images/new/blood.svg',
width: 12,
height: 12,
width: 11,
height: 11,
),
mWidth(6),
Texts('${TranslationBase.of(context).bloodType1} ${model.booldType}', color: Colors.white, fontSize: 10)
Texts(
'${TranslationBase.of(context).bloodType1} ${model.booldType}',
color: Colors.white,
fontSize: 8,
)
],
),
),

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

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -49,6 +50,7 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).weight,
backgroundColor: CustomColors.appBackgroudGrey2Color,
appBarIcons: [
IconButton(
icon: Icon(Icons.email),
@ -106,35 +108,22 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
)
],
),
floatingActionButton: Stack(
children: [
Positioned(
bottom: 80,
right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
)));
},
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,
),
),
)))
],
floatingActionButton: FloatingActionButton(
child: Icon(
Icons.add,
color: Colors.white,
),
backgroundColor: CustomColors.accentColor,
onPressed: () {
Navigator.push(
context,
FadePage(
page: AddWeightPage(
model: model,
),
),
);
},
),
),
),

@ -2,9 +2,11 @@ import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -20,62 +22,74 @@ class WeightMonthlyPage extends StatelessWidget {
this.model,
}) : super(key: key);
List<List> monthlyGroup = [];
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
groupData();
return AppScaffold(
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
// 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
])
])
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
// 2: FlexColumnWidth(1.8),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
])
],
),
)
],
),
)
),
mHeight(80),
],
),
);

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -25,46 +27,64 @@ class WeightWeeklyPage extends StatelessWidget {
return AppScaffold(
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView(
children: [
Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white,
// Container(
// margin: EdgeInsets.only(top: 12, left: 8, right: 8),
// color: Colors.white,
// child: LineChartCurved(
// horizontalInterval: 1.0,
// title: TranslationBase.of(context).weight,
// timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
// indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
// ),
// ),
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, model),
),
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightWeekTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, model),
),
],
),
)
],
),
)
),
mHeight(80),
],
),
);

@ -2,9 +2,11 @@ import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,55 +28,63 @@ class WeightYearPage extends StatelessWidget {
groupData();
return AppScaffold(
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView(
children: [
Container(
width: double.maxFinite,
color: Colors.white,
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: LineChartCurved(
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
)),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
Card(
shape: cardRadius(12),
elevation: 1,
margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
],
crossAxisAlignment: CrossAxisAlignment.start,children: [ Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).details),
),
)
Container(
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weightYearTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: Column(children: [
for (var monthly in monthlyGroup)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Container(
width: double.maxFinite,
padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)),
child: Texts(monthly[0])),
Table(
columnWidths: {
0: FlexColumnWidth(2.5),
},
children: fullData(context, projectViewModel, monthly[1]),
)
])
]),
],
),
)],
),
),
mHeight(80),
],
),
);

@ -36,7 +36,7 @@ class LineChartCurved extends StatelessWidget {
),
Text(
title,
style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
SizedBox(
@ -44,7 +44,7 @@ class LineChartCurved extends StatelessWidget {
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15),
padding: const EdgeInsets.only(right: 18.0, left: 16.0),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
@ -80,6 +80,83 @@ class LineChartCurved extends StatelessWidget {
}
}
}
// 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(
@ -89,8 +166,7 @@ class LineChartCurved extends StatelessWidget {
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
@ -98,8 +174,7 @@ class LineChartCurved extends StatelessWidget {
color: Colors.black,
fontSize: 10,
),
// rotateAngle: 90,
//rotateAngle:-65,
rotateAngle: -65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
@ -108,10 +183,8 @@ class LineChartCurved extends StatelessWidget {
} 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 (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}';
}
@ -121,13 +194,21 @@ class LineChartCurved extends StatelessWidget {
),
leftTitles: SideTitles(
showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
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,
),
),
@ -149,14 +230,14 @@ class LineChartCurved extends StatelessWidget {
),
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: 0,//getMinY(),
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) {
@ -180,9 +261,6 @@ class LineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
if (timeSeries.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
}
@ -191,9 +269,8 @@ class LineChartCurved extends StatelessWidget {
spots: spots,
isCurved: true,
colors: [secondaryColor],
barWidth: 5,
barWidth: 1.5,
isStrokeCapRound: true,
curveSmoothness: 0.12,
dotData: FlDotData(
show: false,
),

@ -36,7 +36,7 @@ class MonthLineChartCurved extends StatelessWidget {
),
Text(
title,
style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
SizedBox(
@ -91,7 +91,12 @@ class MonthLineChartCurved extends StatelessWidget {
handleBuiltInTouches: true,
),
gridData: FlGridData(
horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
horizontalInterval: 12,
show: true,
drawVerticalLine: true,
drawHorizontalLine: true,
verticalInterval: 12,
),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
@ -111,7 +116,11 @@ class MonthLineChartCurved extends StatelessWidget {
fontWeight: FontWeight.bold,
fontSize: 10,
),
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
interval: getMaxY() - getMinY() <= 500
? 50
: getMaxY() - getMinY() <= 1000
? 100
: 200,
// getTitles: (value) {
// if (value.toInt() == 0)
@ -184,7 +193,7 @@ class MonthLineChartCurved extends StatelessWidget {
spots: spots,
isCurved: true,
colors: [secondaryColor],
barWidth: 5,
barWidth: 1.5,
isStrokeCapRound: true,
curveSmoothness: 0.0,
dotData: FlDotData(

@ -7,9 +7,12 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
@ -28,20 +31,13 @@ class PrescriptionDeliveryAddressPage extends StatefulWidget {
final List<PrescriptionReport> prescriptionReportList;
final List<PrescriptionReportEnh> prescriptionReportEnhList;
const PrescriptionDeliveryAddressPage(
{Key key,
this.prescriptions,
this.prescriptionReportList,
this.prescriptionReportEnhList})
: super(key: key);
const PrescriptionDeliveryAddressPage({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList}) : super(key: key);
@override
_PrescriptionDeliveryAddressPageState createState() =>
_PrescriptionDeliveryAddressPageState();
_PrescriptionDeliveryAddressPageState createState() => _PrescriptionDeliveryAddressPageState();
}
class _PrescriptionDeliveryAddressPageState
extends State<PrescriptionDeliveryAddressPage> {
class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAddressPage> {
AddressInfo _selectedAddress;
Completer<GoogleMapController> _controller = Completer();
@ -79,218 +75,252 @@ class _PrescriptionDeliveryAddressPageState
return BaseView<PrescriptionDeliveryViewModel>(
onModelReady: (model) => model.getCustomerInfo(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).shippingAddresss,
baseViewModel: model,
body: Container(
height: MediaQuery.of(context).size.height * 0.65,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectLocationDialog(model.addressesList);
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
height: 50,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(7),
color: Colors.white,
shape: BoxShape.rectangle,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(
getAddressName(),
),
margin: EdgeInsets.only(left: 10, right: 10),
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).shippingAddresss,
baseViewModel: model,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Card(
margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12),
shape: cardRadius(12),
elevation: 3,
child: Container(
child: InkWell(
onTap: () => confirmSelectLocationDialog(model.addressesList),
child: Container(
padding: EdgeInsets.all(8),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
getAddressName(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.45,
),
),
),
Icon(Icons.arrow_drop_down)
],
),
),
),
Icon(
Icons.arrow_drop_down,
size: 22,
color: Colors.grey,
)
],
height: 50,
width: double.infinity,
),
),
),
),
SizedBox(
height: 10,
),
_selectedAddress == null
? Container(
child: Image.asset(
projectViewModel.isArabic
? 'assets/images/pharmacy/shipping_image_ar.png'
: 'assets/images/pharmacy/shipping_image.png',
height: 300,
),
)
: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey)),
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated:
(GoogleMapController controller) {
_controller.complete(controller);
},
InkWell(
onTap: () async {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
)),
).then((value) {
if (value != null && value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
markers = Set();
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
});
}
});
},
child: Padding(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),
child: Row(
children: [
Icon(Icons.add_circle_outline_sharp),
mWidth(12),
Text(
TranslationBase.of(context).addNewAddress,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
SizedBox(
height: 10,
),
Texts(
TranslationBase.of(context).shippingAddresss),
SizedBox(
height: 10,
),
Texts(
'${model.user.firstName} ${model.user.lastName}'),
SizedBox(
height: 10,
),
Texts(_selectedAddress.address1),
SizedBox(
height: 10,
),
Texts(_selectedAddress.address2),
SizedBox(
height: 10,
),
Texts(_selectedAddress.city +
" " +
_selectedAddress.country),
],
),
),
),
if (_selectedAddress != null)
Card(
shape: cardRadius(12),
color: Colors.white,
margin: EdgeInsets.all(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).selectAddress + ":",
fontSize: 12,
color: CustomColors.grey,
fontWeight: FontWeight.w600,
),
mHeight(12),
Container(
height: 175,
decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey),
clipBehavior: Clip.antiAlias,
child: Card(
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
elevation: 0,
margin: const EdgeInsets.all(0),
// child: GoogleMap(
// mapType: MapType.normal,
// markers: markers,
// initialCameraPosition: _kGooglePlex,
// onMapCreated: (GoogleMapController controller) {
// _controller.complete(controller);
// },
// ),
child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=" +
_kGooglePlex.target.latitude.toString() +
"," +
_kGooglePlex.target.longitude.toString() +
"&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" +
_kGooglePlex.target.latitude.toString() +
"," +
_kGooglePlex.target.longitude.toString() +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
),
),
),
SizedBox(
height: 10,
),
Texts(
TranslationBase.of(context).shippingAddresss + ":",
fontSize: 12,
color: CustomColors.grey,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 2,
),
Texts(
'${model.user.firstName} ${model.user.lastName}',
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.address1,
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.address2,
fontSize: 12,
fontWeight: FontWeight.w600,
),
Texts(
_selectedAddress.city + " " + _selectedAddress.country,
fontSize: 12,
fontWeight: FontWeight.w600,
),
],
),
),
)
],
],
),
),
),
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.25,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
Container(
width: MediaQuery.of(context).size.width * 0.8,
Card(
shape: cardRadius(0),
margin: EdgeInsets.zero,
elevation: 20,
child: Container(
width: double.infinity,
padding: EdgeInsets.only(left: 16, right: 16, top: 16),
child: Button(
label:
TranslationBase.of(context).addNewAddress.toUpperCase(),
label: TranslationBase.of(context).continues.toUpperCase(),
disabled: _selectedAddress == null,
backgroundColor: _selectedAddress == null ? CustomColors.grey2 : CustomColors.accentColor,
onTap: () {
Navigator.push(
context,
FadePage(
page: LocationPage(
latitude: latitude,
longitude: longitude,
)),
).then((value) {
if (value != null &&
value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
markers = Set();
markers.add(
Marker(
markerId: MarkerId(
_selectedAddress.latLong.hashCode.toString(),
),
position: LatLng(latitude, longitude),
),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
});
}
});
page: PrescriptionOrderOverview(
latitude: latitude,
longitude: longitude,
prescriptionReportEnhList: widget.prescriptionReportEnhList,
prescriptionReportList: widget.prescriptionReportList,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
),
),
);
},
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label:
TranslationBase.of(context).continues.toUpperCase(),
disabled: _selectedAddress == null,
backgroundColor: _selectedAddress == null
? Colors.green[300]
: Colors.green[700],
onTap: () {
Navigator.push(
context,
FadePage(
page: PrescriptionOrderOverview(
latitude: latitude,
longitude: longitude,
prescriptionReportEnhList:
widget.prescriptionReportEnhList,
prescriptionReportList:
widget.prescriptionReportList,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
),
),
);
},
))
],
),
)),
),
],
),
),
),
);
}

@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
@ -21,6 +23,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
final AddressInfo selectedAddress;
final double latitude;
final double longitude;
PrescriptionOrderOverview({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude});
@override
@ -30,143 +33,167 @@ class PrescriptionOrderOverview extends StatelessWidget {
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).orderOverview,
baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Container(
height: MediaQuery.of(context).size.height * 0.8,
height: double.infinity,
child: Column(
children: [
if (!prescriptions.isInOutPatient)
...List.generate(
prescriptionReportList.length,
(index) => Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
Expanded(
child: Column(
children: [
if (!prescriptions.isInOutPatient)
Card(
margin: EdgeInsets.all(12),
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
...List.generate(
prescriptionReportList.length,
(index) => Card(
margin: EdgeInsets.all(0.0),
color: Colors.white,
shape: cardRadius(0),
elevation: 0,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(prescriptionReportList[index].itemDescription.isNotEmpty
? prescriptionReportList[index].itemDescription
: prescriptionReportList[index].itemDescriptionN)),
)),
],
),
))
],
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
)
else
Card(
margin: EdgeInsets.all(12),
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).invoiceNo + ": " + prescriptions.patientID.toString(),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black,
letterSpacing: -0.46,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
prescriptionReportList[index].itemDescription.isNotEmpty ? prescriptionReportList[index].itemDescription : prescriptionReportList[index].itemDescriptionN)),
)),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
...List.generate(
prescriptionReportEnhList.length,
(index) => Card(
margin: EdgeInsets.all(0.0),
color: Colors.white,
shape: cardRadius(0),
elevation: 0,
child: Row(
children: <Widget>[
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),
],
),
),
),
],
),
),
)
],
),
))
else
...List.generate(
prescriptionReportEnhList.length,
(index) => Container(
margin: EdgeInsets.all(8.0),
color: Colors.white,
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
SizedBox(
width: 10,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(prescriptionReportEnhList[index].itemDescription),
],
),
),
),
Icon(
Icons.arrow_forward_ios,
size: 18,
color: Colors.grey[500],
)
],
),
),
)
],
),
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.15,
color: Colors.grey[100],
child: Column(
children: <Widget>[
SizedBox(
height: 12,
),
],
),
),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: SecondaryButton(
label: TranslationBase.of(context).submit.toUpperCase(),
color: Colors.green[800],
onTap: () async {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmPrescription,
okTitle: TranslationBase.of(context).ok,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model
.insertDeliveryOrder(
lineItemNo: 0,
longitude: longitude,
latitude: latitude,
appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,
createdBy: model.user.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
showErrorDialog(context, model.error);
else {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context, true);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
});
},
),
);
},
))
Card(
shape: cardRadius(0),
margin: EdgeInsets.zero,
elevation: 20,
child: Container(
width: double.infinity,
margin: EdgeInsets.all(12),
child: SecondaryButton(
label: TranslationBase.of(context).submit.toUpperCase(),
color: CustomColors.accentColor,
onTap: () async {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmPrescription,
okTitle: TranslationBase.of(context).ok,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model
.insertDeliveryOrder(
lineItemNo: 0,
longitude: longitude,
latitude: latitude,
appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,
createdBy: model.user.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
showErrorDialog(context, model.error);
else {
Navigator.pop(context);
Navigator.pop(context);
Navigator.pop(context, true);
}
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
});
},
),
);
},
)),
)
],
),
),

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

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

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

@ -137,15 +137,6 @@ class LineChartCurved extends StatelessWidget {
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,
),
),

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

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

@ -86,6 +86,8 @@ class TranslationBase {
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 docQualifications => localizedValues['docQualifications'][locale.languageCode];

@ -10,15 +10,7 @@ import 'package:provider/provider.dart';
/// [loading] show the progress indicator
/// [elevation] color elevation value
class Button extends StatefulWidget {
Button(
{Key key,
this.label: "",
this.icon,
this.onTap,
this.backgroundColor,
this.loading: false,
this.elevation: true, this.disabled=false})
: super(key: key);
Button({Key key, this.label: "", this.icon, this.onTap, this.backgroundColor, this.loading: false, this.elevation: true, this.disabled = false}) : super(key: key);
final String label;
final Widget icon;
@ -37,17 +29,11 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
AnimationController _animationController;
Animation _animation;
PermissionService permission = new PermissionService();
@override
void initState() {
_animationController = AnimationController(
vsync: this,
lowerBound: 0.7,
upperBound: 1.0,
duration: Duration(milliseconds: 120));
_animation = CurvedAnimation(
parent: _animationController,
curve: Curves.easeOutQuad,
reverseCurve: Curves.easeOutQuad);
_animationController = AnimationController(vsync: this, lowerBound: 0.7, upperBound: 1.0, duration: Duration(milliseconds: 120));
_animation = CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuad, reverseCurve: Curves.easeOutQuad);
_animation.addListener(() {
setState(() {
_buttonSize = _animation.value;
@ -64,10 +50,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
Widget _buildIcon() {
if (widget.icon != null && (widget.label != null && widget.label != "")) {
return Container(
margin: EdgeInsets.only(right: 12.0),
height: 24.0,
child: widget.icon);
return Container(margin: EdgeInsets.only(right: 12.0), height: 24.0, child: widget.icon);
} else if (widget.icon != null) {
return Container(
height: 18.0,
@ -94,33 +77,19 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
onTapCancel: () {
_animationController.forward();
},
onTap: () =>{ widget.disabled ? null : widget.onTap(), },
onTap: () => {
widget.disabled ? null : widget.onTap(),
},
behavior: HitTestBehavior.opaque,
child: Transform.scale(
scale: _buttonSize,
child: AnimatedContainer(
duration: Duration(milliseconds: 150),
margin:
EdgeInsets.only(bottom: widget.label.isNotEmpty ? 14.0 : 0.0),
padding: EdgeInsets.symmetric(
vertical: widget.label != null && widget.label.isNotEmpty
? 12.0
: 15.0,
horizontal: widget.label != null && widget.label.isNotEmpty
? 22.0
: 19),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: widget.backgroundColor ?? Theme.of(context).primaryColor,
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
120, 71, 80, widget.elevation ? 0.28 : 0.0),
spreadRadius:
_buttonSize < 1.0 ? -(1 - _buttonSize) * 50 : 0.0,
offset: Offset(0, 7.0),
blurRadius: 24.0)
]),
margin: EdgeInsets.only(bottom: widget.label.isNotEmpty ? 14.0 : 0.0),
padding: EdgeInsets.symmetric(vertical: widget.label != null && widget.label.isNotEmpty ? 12.0 : 12.0, horizontal: widget.label != null && widget.label.isNotEmpty ? 22.0 : 19),
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.0)), color: widget.backgroundColor ?? Theme.of(context).primaryColor, boxShadow: [
BoxShadow(color: Color.fromRGBO(120, 71, 80, widget.elevation ? 0.28 : 0.0), spreadRadius: _buttonSize < 1.0 ? -(1 - _buttonSize) * 50 : 0.0, offset: Offset(0, 7.0), blurRadius: 24.0)
]),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
@ -145,10 +114,11 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
padding: EdgeInsets.only(bottom: 3.0),
child: Text(widget.label,
style: TextStyle(
color: Colors.white,
fontSize: 17.0,
fontWeight: FontWeight.w700,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
color: Colors.white,
fontSize: 16.0,
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
)),
)
],
),

@ -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,
mainAxisAlignment: MainAxisAlignment.center,
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -8,74 +10,89 @@ class ConfirmWithMessageDialog extends StatelessWidget {
final String okTitle;
final GestureTapCallback onTap;
const ConfirmWithMessageDialog(
{Key key, this.message, this.okTitle, this.onTap})
: super(key: key);
const ConfirmWithMessageDialog({Key key, this.message, this.okTitle, this.onTap}) : super(key: key);
@override
Widget build(BuildContext context) {
return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center(
child: Texts(
TranslationBase.of(context).confirm,
color: Colors.black,
),
),
contentPadding: EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 12.0),
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: Texts(
message,
fontSize: 14,
Text(
TranslationBase.of(context).confirm,
style: TextStyle(
color: Colors.black,
fontSize: 22,
letterSpacing: -0.94,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 5,
),
Divider(),
SizedBox(
height: 5.0,
Text(
message,
style: TextStyle(
fontSize: 14,
color: CustomColors.grey,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
),
mHeight(20),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel,
color: Colors.red,
Expanded(
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
decoration: containerRadius(CustomColors.darkGreyColor, 6),
padding: EdgeInsets.all(6),
child: Center(
child: Text(
TranslationBase.of(context).cancel,
style: TextStyle(
color: Colors.black,
fontSize: 16,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
),
),
),
InkWell(
onTap: () {
Navigator.pop(context);
onTap();
},
child: Container(
child: Center(
child: Texts(okTitle),
mWidth(12),
Expanded(
child: InkWell(
onTap: () {
Navigator.pop(context);
onTap();
},
child: Container(
decoration: containerRadius(CustomColors.accentColor, 6),
padding: EdgeInsets.all(6),
child: Center(
child: Text(
okTitle,
style: TextStyle(
color: Colors.white,
fontSize: 16,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
),
),
),
],
),
),
SizedBox(
height: 20.0,
),
],
)
],

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -13,33 +15,34 @@ class ConfirmDialog {
final Function okFunction;
final Function cancelFunction;
ConfirmDialog(
{@required this.context,
this.title,
@required this.confirmMessage,
@required this.okText,
@required this.cancelText,
@required this.okFunction,
@required this.cancelFunction});
ConfirmDialog({@required this.context, this.title, @required this.confirmMessage, @required this.okText, @required this.cancelText, @required this.okFunction, @required this.cancelFunction});
showAlertDialog(BuildContext context) {
// set up the buttons
Widget cancelButton = FlatButton(
child: Texts(this.cancelText),
onPressed: () {
Navigator.of(context).pop();
cancelFunction();
});
Widget continueButton = FlatButton(child: Texts(okText), onPressed: okFunction);
// set up the AlertDialog
AlertDialog alert = AlertDialog(
title: title != null ? Text(title) : Text(TranslationBase.of(context).confirm),
content: Text(this.confirmMessage),
actions: [
cancelButton,
continueButton,
],
// AlertDialog alert = AlertDialog(
// title: title != null ? Text(title) : Text(TranslationBase.of(context).confirm),
// content: Text(this.confirmMessage),
// actions: [
// cancelButton,
// continueButton,
// ],
// );
Dialog alert = Dialog(
child: Container(
color: Colors.transparent,
child: Mdialog(
context,
title != null ? title : TranslationBase.of(context).confirm,
confirmMessage,
okText,
cancelText,
cancelFunction: cancelFunction,
okFunction: okFunction,
),
),
);
// show the dialog
@ -54,5 +57,84 @@ class ConfirmDialog {
static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop();
}
}
class Mdialog extends StatelessWidget {
String title;
String description;
final Function okFunction;
final Function cancelFunction;
final okText;
final cancelText;
BuildContext _context;
Mdialog(this._context, this.title, this.description, this.okText, this.cancelText, {this.okFunction, this.cancelFunction});
@override
Widget build(BuildContext context) {
return Container(
decoration: containerRadius(Colors.white, 12),
padding: EdgeInsets.all(20),
clipBehavior: Clip.antiAlias,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
// title != null ? title : TranslationBase.of(context).confirm,
title,
style: TextStyle(
fontSize: 24,
letterSpacing: -0.94,
fontWeight: FontWeight.w600,
),
),
Text(
// this.confirmMessage,
description,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: CustomColors.grey,
fontWeight: FontWeight.w600,
),
),
mHeight(16),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
Navigator.of(_context).pop();
cancelFunction();
},
child: Container(
decoration: containerRadius(CustomColors.lightGreyColor, 12),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Center(child: Texts(cancelText)),
),
),
),
mWidth(8),
Expanded(
child: InkWell(
onTap: okFunction,
child: Container(
decoration: containerRadius(CustomColors.accentColor, 12),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Center(
child: Texts(
okText,
color: Colors.white,
),
),
),
),
)
],
)
],
),
);
}
}

@ -114,7 +114,7 @@ class AppScaffold extends StatelessWidget {
dropdownIndexValue: dropdownIndexValue,
dropDownList: dropDownList ?? [],
dropDownIndexChange: dropDownIndexChange,
)
appBarIcons: appBarIcons)
: (isShowAppBar
? appBar = AppBarWidget(
appBarTitle: appBarTitle,
@ -166,7 +166,9 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final int dropdownIndexValue;
List<String> dropDownList;
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
Widget build(BuildContext context) {
@ -224,9 +226,12 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
),
),
),
)
),
],
),
actions: <Widget>[
if (appBarIcons != null) ...appBarIcons,
],
);
}

Loading…
Cancel
Save