Meal Plan implementation completed

merge-update-with-lab-changes
haroon amjad 3 years ago
parent bc27121c4e
commit 0e054429ef

@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:3334/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -611,6 +611,7 @@ var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients';
var GET_CURRENT_WEEKID_WEEKDAY = 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP';
var GET_MEALS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile';
var GET_MEAL_ITEMS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID';
var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder';
class AppGlobal {
static var context;

@ -1925,4 +1925,6 @@ const Map localizedValues = {
},
"birthNotificationNotes2": {"en": "Non Saudis: Provide copy of iqama or copy of the passport.", "ar": "لغير السعوديين : إرفاق صورة الإقامة آأو جواز السفر"},
"birthNotificationNotes3": {"en": "For Residents without identification card: Provide marriage contract.", "ar": "للمواطنين الغير حاملين لبطاقة الأحوال : إرفاق صورة من عقد الزواج برقم الحاسب"},
"placeOrder": {"en": "Place Order", "ar": "مكان الامر"},
"isFasting": {"en": "Are you fasting?", "ar": "هل أنت صائم؟"},
};

@ -152,8 +152,8 @@ class BaseAppClient {
// body['PatientID'] = 2480363; //3844083
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 3649238; //3844083
// body['AdmissionNo'] = 2023000038; //3844083
// body['PatientID'] = 3649689; //3844083
// body['AdmissionNo'] = 2023000040; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -1,3 +1,5 @@
import 'package:flutter/material.dart';
class GetMealItemsScheduleResponseModel {
int itemID;
String description;
@ -63,6 +65,9 @@ class GetMealItemsScheduleResponseModelList {
String filterName = "";
List<GetMealItemsScheduleResponseModel> getMealItemsScheduleResponseModelList = [];
// int selectedItemID = 0;
final ValueNotifier<int> selectedItemID = ValueNotifier(0);
GetMealItemsScheduleResponseModelList({this.filterName, GetMealItemsScheduleResponseModel getMealItemsScheduleResponseModel}) {
getMealItemsScheduleResponseModelList.add(getMealItemsScheduleResponseModel);
}

@ -168,20 +168,25 @@ class _BirthNotificationState extends State<BirthNotification> {
// color: CustomColors.accentColor,
// disabledColor: CustomColors.grey2,
// ),
DefaultButton(
TranslationBase.of(context).submit,
(fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty)
? null
: () {
submitBirthNotification();
},
color: CustomColors.accentColor,
disabledColor: CustomColors.grey2,
),
],
),
),
),
bottomSheet: Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20),
child: DefaultButton(
TranslationBase.of(context).submit,
(fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty)
? null
: () {
submitBirthNotification();
},
color: CustomColors.accentColor,
disabledColor: CustomColors.grey2,
),
),
);
}
@ -210,15 +215,6 @@ class _BirthNotificationState extends State<BirthNotification> {
images.clear();
images.add(image);
setState(() {});
// GifLoaderDialogUtils.showMyDialog(context);
// await model.uploadInsuranceCard(context, patientIdentificationID: patientIdentificationID, patientID: patientID, image: image);
// GifLoaderDialogUtils.hideDialog(context);
// if (model.state == ViewState.ErrorLocal || model.state == ViewState.Error) {
// AppToast.showErrorToast(message: model.error);
// } else {
// AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent);
// }
// Navigator.pop(context);
},
isBirthNotification: true,
),

@ -10,6 +10,7 @@ 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/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -39,6 +40,11 @@ class _MealPlanPageState extends State<MealPlanPage> {
int currentDay = 0;
int currentWeek = 0;
int selectedMealScheduleID = 0;
final ValueNotifier<bool> isFasting = ValueNotifier(false);
bool isFastingVal = false;
@override
void initState() {
super.initState();
@ -59,298 +65,405 @@ class _MealPlanPageState extends State<MealPlanPage> {
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(21.0),
child: Column(
children: [
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[0].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isDisabled: !getMealsScheduleResponseModelList[0].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelBreakfast[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LargeAvatar(
name: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
child: getMealsScheduleResponseModelList.length != 0
? Column(
children: [
Container(
decoration: containerRadius((getMealsScheduleResponseModelList[0].isShow) ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[0].isShow,
isDisabled: !getMealsScheduleResponseModelList[0].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelBreakfast[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
ValueListenableBuilder<int>(
valueListenable: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID,
builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value,
activeColor: Colors.red[800],
onChanged: (value) {
_getMealItemsScheduleResponseModelBreakfast[index].selectedItemID.value = value;
},
);
}),
LargeAvatar(
name: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
],
),
),
],
),
),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelBreakfast.length),
],
),
),
),
mHeight(21),
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[1].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isDisabled: !getMealsScheduleResponseModelList[1].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelLunch[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
LargeAvatar(
name: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelBreakfast.length),
],
),
),
),
mHeight(21),
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[1].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[1].isShow,
isDisabled: !getMealsScheduleResponseModelList[1].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelLunch[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
ValueListenableBuilder<int>(
valueListenable: _getMealItemsScheduleResponseModelLunch[index].selectedItemID,
builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelLunch[index].selectedItemID.value,
activeColor: Colors.red[800],
onChanged: (value) {
_getMealItemsScheduleResponseModelLunch[index].selectedItemID.value = value;
},
);
}),
LargeAvatar(
name: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
],
),
),
],
),
),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelLunch.length),
],
),
),
),
mHeight(21),
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[2].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isDisabled: !getMealsScheduleResponseModelList[2].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelDinner[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Radio(
value: index,
groupValue: _getMealItemsScheduleResponseModelDinner[index].filterName,
activeColor: Colors.red[800],
onChanged: (value) {
// setState(() {
// selected = value;
// parameterCode = model.askDoctorReqTypes[index].parameterCode;
// });
},
),
LargeAvatar(
name: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelLunch.length),
],
),
),
),
mHeight(21),
Container(
decoration: containerRadius(getMealsScheduleResponseModelList[2].isShow ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier(
title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime),
isTitleSingleLine: false,
widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[2].isShow,
isDisabled: !getMealsScheduleResponseModelList[2].isShow,
bodyWidget: Column(
children: [
getDivider(),
ListView.separated(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.all(21.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(_getMealItemsScheduleResponseModelDinner[index].filterName,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0, letterSpacing: -0.64, color: CustomColors.darkGrey)),
SizedBox(
height: 12.0,
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index2) {
return Container(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
ValueListenableBuilder<int>(
valueListenable: _getMealItemsScheduleResponseModelDinner[index].selectedItemID,
builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value,
activeColor: Colors.red[800],
onChanged: (value) {
_getMealItemsScheduleResponseModelDinner[index].selectedItemID.value = value;
},
);
}),
LargeAvatar(
name: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
width: 60,
height: 60,
radius: 5,
disableProfileView: true,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(
"",
projectViewModel.isArabic
? _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].descriptionN
: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
projectViewModel.isArabic),
],
),
),
],
),
),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelDinner.length),
],
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.all(16.0),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList.length),
],
),
);
},
separatorBuilder: (context, index) {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
child: Divider(
height: 1.5,
thickness: 1.0,
color: Colors.grey.shade200,
),
);
},
itemCount: _getMealItemsScheduleResponseModelDinner.length),
],
),
),
),
],
)
: Container(),
),
),
bottomSheet: Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
ValueListenableBuilder<bool>(
valueListenable: isFasting,
builder: (context, val, child) {
return Checkbox(
onChanged: (bool value) {
isFasting.value = value;
isFastingVal = value;
},
value: isFastingVal,
activeColor: Color(0xFFc5272d),
);
}),
Text(
TranslationBase.of(context).isFasting,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.48,
),
),
),
],
),
],
),
mHeight(12),
DefaultButton(
TranslationBase.of(context).placeOrder,
() {
placeOrder();
},
color: Color(0xff359846),
disabledColor: Colors.grey,
),
],
),
),
);
}
void placeOrder() {
List<String> selectedItemIDs = [];
if (_getMealItemsScheduleResponseModelBreakfast.isNotEmpty) {
_getMealItemsScheduleResponseModelBreakfast.forEach((element) {
selectedItemIDs.add(element.selectedItemID.value.toString());
});
}
if (_getMealItemsScheduleResponseModelLunch.isNotEmpty) {
_getMealItemsScheduleResponseModelLunch.forEach((element) {
selectedItemIDs.add(element.selectedItemID.value.toString());
});
}
if (_getMealItemsScheduleResponseModelDinner.isNotEmpty) {
_getMealItemsScheduleResponseModelDinner.forEach((element) {
selectedItemIDs.add(element.selectedItemID.value.toString());
});
}
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.placeMealPlanOrder(getAdmittedPatientsResponseModel.projectID, selectedMealScheduleID, selectedItemIDs.join(","), projectViewModel.user.patientID,
getAdmittedPatientsResponseModel.admissionNo, getAdmittedPatientsResponseModel.isHasCompanion, isFastingVal, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "Your meal order has been received successfully");
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
Widget getDivider() {
return Padding(
padding: EdgeInsets.only(left: 15, right: 15),
@ -405,9 +518,18 @@ class _MealPlanPageState extends State<MealPlanPage> {
res['List_MOP_MealsOfScheduleID_Mobile'].forEach((scheduleItem) {
getMealsScheduleResponseModelList.add(GetMealsScheduleResponseModel.fromJson(scheduleItem));
});
if (getMealsScheduleResponseModelList[0].isShow) getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID, 1);
if (getMealsScheduleResponseModelList[1].isShow) getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID, 2);
if (getMealsScheduleResponseModelList[2].isShow) getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID, 3);
if (getMealsScheduleResponseModelList[0].isShow) {
selectedMealScheduleID = getMealsScheduleResponseModelList[0].scheduleID;
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID, 1);
}
if (getMealsScheduleResponseModelList[1].isShow) {
selectedMealScheduleID = getMealsScheduleResponseModelList[1].scheduleID;
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID, 2);
}
if (getMealsScheduleResponseModelList[2].isShow) {
selectedMealScheduleID = getMealsScheduleResponseModelList[2].scheduleID;
getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID, 3);
}
} else {
AppToast.showErrorToast(message: "No meal schedule found for admitted patient");
}
@ -463,6 +585,14 @@ class _MealPlanPageState extends State<MealPlanPage> {
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
}
});
_getMealItemsScheduleResponseModelBreakfast.forEach((element) {
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
if (elementInner.isDefault) {
element.selectedItemID.value = elementInner.itemID;
}
});
});
}
void sortMealsByCategoryLunch() {
@ -477,6 +607,14 @@ class _MealPlanPageState extends State<MealPlanPage> {
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
}
});
_getMealItemsScheduleResponseModelLunch.forEach((element) {
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
if (elementInner.isDefault) {
element.selectedItemID.value = elementInner.itemID;
}
});
});
}
void sortMealsByCategoryDinner() {
@ -491,5 +629,12 @@ class _MealPlanPageState extends State<MealPlanPage> {
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element));
}
});
_getMealItemsScheduleResponseModelDinner.forEach((element) {
element.getMealItemsScheduleResponseModelList.forEach((elementInner) {
if (elementInner.isDefault) {
element.selectedItemID.value = elementInner.itemID;
}
});
});
}
}

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_info
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter/material.dart';
class ClinicListService extends BaseService {
@ -277,14 +278,7 @@ class ClinicListService extends BaseService {
Future<Map> getAdmittedPatientDetails(int patientID, int projectID, int admissionNo, int buildingID, int floorID, int nursingStationID, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"PatientID" : patientID,
"AdmissionNo": admissionNo,
"BuildingID" : buildingID,
"FloorID" : floorID,
"NursingStationID": nursingStationID
};
request = {"ProjectID": projectID, "PatientID": patientID, "AdmissionNo": admissionNo, "BuildingID": buildingID, "FloorID": floorID, "NursingStationID": nursingStationID};
dynamic localRes;
@ -311,8 +305,8 @@ class ClinicListService extends BaseService {
request = {
"ProjectID": projectID,
"AdmissionNo": admissionNo,
"BuildingID" : 0,
"FloorID" : 0,
"BuildingID": 0,
"FloorID": 0,
"NursingStationID": 0,
"DietType": dietType,
"WeekID": weekID,
@ -346,4 +340,35 @@ class ClinicListService extends BaseService {
return Future.value(localRes);
}
Future<Map> placeMealPlanOrder(int projectID, int scheduleID, String itemIDList, int patientID, int admissionNo, bool isCompanion, bool isFasting, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"ItemIDList": itemIDList,
"IsActive": true,
"OrderDate": DateUtil.getISODateFormat(DateTime.now()).replaceAll("T", " "),
"PatientID": patientID,
"AdmissionNo": admissionNo,
"IsCompanion": isCompanion,
"IsFasting": isFasting,
"CreatedBy": patientID,
"EditedBy": patientID,
"MealScheduleID": scheduleID,
"MealStatus": 1,
"ItemStatus": 0,
"ConfirmedBy": patientID,
"Remarks": "",
"IsVIP": false,
"IsFixedRemarks": false
};
dynamic localRes;
await baseAppClient.post(PLACE_MEAL_PLAN_ORDER, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
}

@ -2918,6 +2918,8 @@ class TranslationBase {
String get birthNotificationNotes1 => localizedValues["birthNotificationNotes1"][locale.languageCode];
String get birthNotificationNotes2 => localizedValues["birthNotificationNotes2"][locale.languageCode];
String get birthNotificationNotes3 => localizedValues["birthNotificationNotes3"][locale.languageCode];
String get placeOrder => localizedValues["placeOrder"][locale.languageCode];
String get isFasting => localizedValues["isFasting"][locale.languageCode];
}

@ -31,16 +31,11 @@ Widget getPaymentMethods() {
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset("assets/images/new/payment/Mada.png",
width: 40, height: 40),
Image.asset("assets/images/new/payment/tamara_en.png",
width: 40, height: 40),
Image.asset("assets/images/new/payment/visa.png",
width: 40, height: 40),
Image.asset("assets/images/new/payment/Mastercard.png",
width: 50, height: 40),
Image.asset("assets/images/new/payment/Apple_Pay.png",
width: 40, height: 40),
Image.asset("assets/images/new/payment/Mada.png", width: 40, height: 40),
Image.asset("assets/images/new/payment/tamara_en.png", width: 40, height: 40),
Image.asset("assets/images/new/payment/visa.png", width: 40, height: 40),
Image.asset("assets/images/new/payment/Mastercard.png", width: 50, height: 40),
Image.asset("assets/images/new/payment/Apple_Pay.png", width: 40, height: 40),
],
),
);
@ -52,15 +47,8 @@ Widget getNoDataWidget(BuildContext context) {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset('assets/images/new/not_found.svg',
width: 110.0, height: 110.0),
Container(
margin: EdgeInsets.only(top: 15.0),
child: Text(TranslationBase.of(context).noResultFound,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFFBABABA)))),
SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0),
Container(margin: EdgeInsets.only(top: 15.0), child: Text(TranslationBase.of(context).noResultFound, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xFFBABABA)))),
],
),
),
@ -88,8 +76,7 @@ spacer() {
}
Future navigateTo(context, page) async {
return await Navigator.push(
context, MaterialPageRoute(builder: (context) => page));
return await Navigator.push(context, MaterialPageRoute(builder: (context) => page));
}
// Future navigateToReplace(context, page) async {
@ -147,11 +134,7 @@ Widget circularAviator(
child: Container(
width: s,
height: s,
decoration: containerColorRadiusBorderWidth(
bcColor == null ? Colors.grey[200] : bcColor,
2000,
brColor == null ? Colors.blueGrey[800] : brColor,
borderWidth == null ? 2 : borderWidth),
decoration: containerColorRadiusBorderWidth(bcColor == null ? Colors.grey[200] : bcColor, 2000, brColor == null ? Colors.blueGrey[800] : brColor, borderWidth == null ? 2 : borderWidth),
child: Icon(
icon == null ? Icons.person : icon,
size: s / 1.7,
@ -233,8 +216,7 @@ RoundedRectangleBorder buttonShape() {
);
}
Decoration containerRadiusWithGradient(double radius,
{Color color1, Color color2}) {
Decoration containerRadiusWithGradient(double radius, {Color color1, Color color2}) {
return BoxDecoration(
borderRadius: BorderRadius.circular(radius),
gradient: LinearGradient(
@ -248,8 +230,7 @@ Decoration containerRadiusWithGradient(double radius,
);
}
Decoration containerBottomRightRadiusWithGradient(double radius,
{Color darkColor, Color lightColor}) {
Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColor, Color lightColor}) {
return BoxDecoration(
borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)),
gradient: LinearGradient(
@ -263,8 +244,7 @@ Decoration containerBottomRightRadiusWithGradient(double radius,
);
}
Decoration containerBottomRightRadiusWithGradientForAr(double radius,
{Color darkColor, Color lightColor}) {
Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color darkColor, Color lightColor}) {
return BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)),
gradient: LinearGradient(
@ -307,11 +287,7 @@ Decoration containerRadiusWithGradientServices(
);
}
Decoration containerBottomRightRadiusWithGradientBorder(double radius,
{Color darkColor,
Color lightColor,
Color borderColor = Colors.transparent,
double w = 0}) {
Decoration containerBottomRightRadiusWithGradientBorder(double radius, {Color darkColor, Color lightColor, Color borderColor = Colors.transparent, double w = 0}) {
return BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(radius)),
border: Border.all(
@ -332,6 +308,13 @@ Decoration containerBottomRightRadiusWithGradientBorder(double radius,
Decoration containerRadius(Color background, double radius) {
return BoxDecoration(
color: background,
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
border: Border.all(
width: 1, //
color: background // <--- border width here
@ -340,8 +323,7 @@ Decoration containerRadius(Color background, double radius) {
);
}
Decoration containerColorRadiusBorder(
Color background, double radius, Color color) {
Decoration containerColorRadiusBorder(Color background, double radius, Color color) {
return BoxDecoration(
color: background,
border: Border.all(
@ -352,8 +334,7 @@ Decoration containerColorRadiusBorder(
);
}
Decoration containerColorRadiusBorderWidth(
Color background, double radius, Color color, double w) {
Decoration containerColorRadiusBorderWidth(Color background, double radius, Color color, double w) {
return BoxDecoration(
color: background,
border: Border.all(
@ -364,8 +345,7 @@ Decoration containerColorRadiusBorderWidth(
);
}
Decoration containerColorRadiusBorderWidthCircular(
Color background, double radius, Color color, double w) {
Decoration containerColorRadiusBorderWidthCircular(Color background, double radius, Color color, double w) {
return BoxDecoration(
color: background,
border: Border.all(
@ -380,36 +360,29 @@ Decoration containerColorRadiusBorderWidthCircular(
Decoration containerColorRadiusRight(Color background, double radius) {
return BoxDecoration(
color: background,
borderRadius: BorderRadius.only(
topRight: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)),
);
}
Decoration containerColorRadiusLeft(Color background, double radius) {
return BoxDecoration(
color: background,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
);
}
Decoration containerColorRadiusRightBorder(
Color background, double radius, double w) {
Decoration containerColorRadiusRightBorder(Color background, double radius, double w) {
return BoxDecoration(
color: background,
border: Border.all(
width: w, //
color: Colors.white // <--- border width here
),
borderRadius: BorderRadius.only(
topRight: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)),
);
}
Decoration containerColorRadiusRightBorderc(
Color background, double radius, double w, Color borderColor) {
Decoration containerColorRadiusRightBorderc(Color background, double radius, double w, Color borderColor) {
return BoxDecoration(
color: background,
border: Border.all(
@ -440,16 +413,14 @@ Decoration containerColorRadiusBottom(Color color, double radius) {
);
}
Decoration containerColorRadiusLeftBorder(
Color background, double radius, double w) {
Decoration containerColorRadiusLeftBorder(Color background, double radius, double w) {
return BoxDecoration(
color: background,
border: Border.all(
width: w, //
color: Colors.white // <--- border width here
),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
);
}
@ -481,23 +452,19 @@ ShapeBorder cardRadiusNew(double radius) {
ShapeBorder cardRadiusTop(double radius) {
return RoundedRectangleBorder(
side: BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
);
}
ShapeBorder cardRadiusTop2(double radius) {
return RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
);
}
ShapeBorder cardRadiusBottom(double radius) {
return RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius), bottomRight: Radius.circular(radius)),
);
}
@ -620,8 +587,7 @@ FontStyle getFontStyle(String fontStyle) {
bool timeCalculator(int startHour, int startMint, int endHour, int endMint) {
DateTime now = DateTime.now();
DateTime startDate =
DateTime(now.year, now.month, now.day, startHour, startHour);
DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour);
DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint);
if (startDate.isBefore(now) && endDate.isAfter(now))
return true;

Loading…
Cancel
Save