Meal Plan implementation completed

Dev_3.3_InPatient_CR
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_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:3334/'; // var BASE_URL = 'http://10.50.100.198:3334/';
// var BASE_URL = 'https://uat.hmgwebservices.com/'; var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.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_CURRENT_WEEKID_WEEKDAY = 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP';
var GET_MEALS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile'; 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 GET_MEAL_ITEMS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID';
var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder';
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -1925,4 +1925,6 @@ const Map localizedValues = {
}, },
"birthNotificationNotes2": {"en": "Non Saudis: Provide copy of iqama or copy of the passport.", "ar": "لغير السعوديين : إرفاق صورة الإقامة آأو جواز السفر"}, "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": "للمواطنين الغير حاملين لبطاقة الأحوال : إرفاق صورة من عقد الزواج برقم الحاسب"}, "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['PatientID'] = 2480363; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['PatientID'] = 3649238; //3844083 // body['PatientID'] = 3649689; //3844083
// body['AdmissionNo'] = 2023000038; //3844083 // body['AdmissionNo'] = 2023000040; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

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

@ -168,7 +168,15 @@ class _BirthNotificationState extends State<BirthNotification> {
// color: CustomColors.accentColor, // color: CustomColors.accentColor,
// disabledColor: CustomColors.grey2, // disabledColor: CustomColors.grey2,
// ), // ),
DefaultButton( ],
),
),
),
bottomSheet: Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(20),
child: DefaultButton(
TranslationBase.of(context).submit, TranslationBase.of(context).submit,
(fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty) (fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty)
? null ? null
@ -178,9 +186,6 @@ class _BirthNotificationState extends State<BirthNotification> {
color: CustomColors.accentColor, color: CustomColors.accentColor,
disabledColor: CustomColors.grey2, disabledColor: CustomColors.grey2,
), ),
],
),
),
), ),
); );
} }
@ -210,15 +215,6 @@ class _BirthNotificationState extends State<BirthNotification> {
images.clear(); images.clear();
images.add(image); images.add(image);
setState(() {}); 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, 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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.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/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -39,6 +40,11 @@ class _MealPlanPageState extends State<MealPlanPage> {
int currentDay = 0; int currentDay = 0;
int currentWeek = 0; int currentWeek = 0;
int selectedMealScheduleID = 0;
final ValueNotifier<bool> isFasting = ValueNotifier(false);
bool isFastingVal = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -59,14 +65,16 @@ class _MealPlanPageState extends State<MealPlanPage> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Padding( child: Padding(
padding: EdgeInsets.all(21.0), padding: EdgeInsets.all(21.0),
child: Column( child: getMealsScheduleResponseModelList.length != 0
? Column(
children: [ children: [
Container( Container(
decoration: containerRadius(getMealsScheduleResponseModelList[0].isShow ? Colors.white : Colors.grey[300], 12), decoration: containerRadius((getMealsScheduleResponseModelList[0].isShow) ? Colors.white : Colors.grey[300], 12),
child: AppExpandableNotifier( child: AppExpandableNotifier(
title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime), title: "Breakfast TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[0].tATTime),
isTitleSingleLine: false, isTitleSingleLine: false,
widgetColor: Colors.transparent, widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[0].isShow,
isDisabled: !getMealsScheduleResponseModelList[0].isShow, isDisabled: !getMealsScheduleResponseModelList[0].isShow,
bodyWidget: Column( bodyWidget: Column(
children: [ children: [
@ -94,6 +102,18 @@ class _MealPlanPageState extends State<MealPlanPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
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( LargeAvatar(
name: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description, name: _getMealItemsScheduleResponseModelBreakfast[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg", url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
@ -158,6 +178,7 @@ class _MealPlanPageState extends State<MealPlanPage> {
title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime), title: "Lunch TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[1].tATTime),
isTitleSingleLine: false, isTitleSingleLine: false,
widgetColor: Colors.transparent, widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[1].isShow,
isDisabled: !getMealsScheduleResponseModelList[1].isShow, isDisabled: !getMealsScheduleResponseModelList[1].isShow,
bodyWidget: Column( bodyWidget: Column(
children: [ children: [
@ -185,6 +206,18 @@ class _MealPlanPageState extends State<MealPlanPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
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( LargeAvatar(
name: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description, name: _getMealItemsScheduleResponseModelLunch[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg", url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
@ -249,6 +282,7 @@ class _MealPlanPageState extends State<MealPlanPage> {
title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime), title: "Dinner TAT: " + DateUtil.convertTime(getMealsScheduleResponseModelList[2].tATTime),
isTitleSingleLine: false, isTitleSingleLine: false,
widgetColor: Colors.transparent, widgetColor: Colors.transparent,
isExpand: getMealsScheduleResponseModelList[2].isShow,
isDisabled: !getMealsScheduleResponseModelList[2].isShow, isDisabled: !getMealsScheduleResponseModelList[2].isShow,
bodyWidget: Column( bodyWidget: Column(
children: [ children: [
@ -276,17 +310,18 @@ class _MealPlanPageState extends State<MealPlanPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Radio( ValueListenableBuilder<int>(
value: index, valueListenable: _getMealItemsScheduleResponseModelDinner[index].selectedItemID,
groupValue: _getMealItemsScheduleResponseModelDinner[index].filterName, builder: (context, val, child) {
return Radio(
value: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].itemID,
groupValue: _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
// setState(() { _getMealItemsScheduleResponseModelDinner[index].selectedItemID.value = value;
// selected = value;
// parameterCode = model.askDoctorReqTypes[index].parameterCode;
// });
}, },
), );
}),
LargeAvatar( LargeAvatar(
name: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description, name: _getMealItemsScheduleResponseModelDinner[index].getMealItemsScheduleResponseModelList[index2].description,
url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg", url: "https://www.pumpkinnspice.com/wp-content/uploads/2016/03/easy-breakfast-quesadillas-11-683x1024.jpg",
@ -345,12 +380,90 @@ class _MealPlanPageState extends State<MealPlanPage> {
), ),
), ),
], ],
)
: 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() { Widget getDivider() {
return Padding( return Padding(
padding: EdgeInsets.only(left: 15, right: 15), padding: EdgeInsets.only(left: 15, right: 15),
@ -405,9 +518,18 @@ class _MealPlanPageState extends State<MealPlanPage> {
res['List_MOP_MealsOfScheduleID_Mobile'].forEach((scheduleItem) { res['List_MOP_MealsOfScheduleID_Mobile'].forEach((scheduleItem) {
getMealsScheduleResponseModelList.add(GetMealsScheduleResponseModel.fromJson(scheduleItem)); getMealsScheduleResponseModelList.add(GetMealsScheduleResponseModel.fromJson(scheduleItem));
}); });
if (getMealsScheduleResponseModelList[0].isShow) getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[0].scheduleID, 1); if (getMealsScheduleResponseModelList[0].isShow) {
if (getMealsScheduleResponseModelList[1].isShow) getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[1].scheduleID, 2); selectedMealScheduleID = getMealsScheduleResponseModelList[0].scheduleID;
if (getMealsScheduleResponseModelList[2].isShow) getDefaultItemsOfScheduleID(getMealsScheduleResponseModelList[2].scheduleID, 3); 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 { } else {
AppToast.showErrorToast(message: "No meal schedule found for admitted patient"); 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)); .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() { void sortMealsByCategoryLunch() {
@ -477,6 +607,14 @@ class _MealPlanPageState extends State<MealPlanPage> {
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element)); .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() { void sortMealsByCategoryDinner() {
@ -491,5 +629,12 @@ class _MealPlanPageState extends State<MealPlanPage> {
.add(GetMealItemsScheduleResponseModelList(filterName: projectViewModel.isArabic ? element.categoryDescriptionN : element.categoryDescription, getMealItemsScheduleResponseModel: element)); .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/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ClinicListService extends BaseService { 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 { Future<Map> getAdmittedPatientDetails(int patientID, int projectID, int admissionNo, int buildingID, int floorID, int nursingStationID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {"ProjectID": projectID, "PatientID": patientID, "AdmissionNo": admissionNo, "BuildingID": buildingID, "FloorID": floorID, "NursingStationID": nursingStationID};
"ProjectID": projectID,
"PatientID" : patientID,
"AdmissionNo": admissionNo,
"BuildingID" : buildingID,
"FloorID" : floorID,
"NursingStationID": nursingStationID
};
dynamic localRes; dynamic localRes;
@ -311,8 +305,8 @@ class ClinicListService extends BaseService {
request = { request = {
"ProjectID": projectID, "ProjectID": projectID,
"AdmissionNo": admissionNo, "AdmissionNo": admissionNo,
"BuildingID" : 0, "BuildingID": 0,
"FloorID" : 0, "FloorID": 0,
"NursingStationID": 0, "NursingStationID": 0,
"DietType": dietType, "DietType": dietType,
"WeekID": weekID, "WeekID": weekID,
@ -346,4 +340,35 @@ class ClinicListService extends BaseService {
return Future.value(localRes); 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 birthNotificationNotes1 => localizedValues["birthNotificationNotes1"][locale.languageCode];
String get birthNotificationNotes2 => localizedValues["birthNotificationNotes2"][locale.languageCode]; String get birthNotificationNotes2 => localizedValues["birthNotificationNotes2"][locale.languageCode];
String get birthNotificationNotes3 => localizedValues["birthNotificationNotes3"][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, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset("assets/images/new/payment/Mada.png", Image.asset("assets/images/new/payment/Mada.png", width: 40, height: 40),
width: 40, height: 40), Image.asset("assets/images/new/payment/tamara_en.png", width: 40, height: 40),
Image.asset("assets/images/new/payment/tamara_en.png", Image.asset("assets/images/new/payment/visa.png", width: 40, height: 40),
width: 40, height: 40), Image.asset("assets/images/new/payment/Mastercard.png", width: 50, height: 40),
Image.asset("assets/images/new/payment/visa.png", Image.asset("assets/images/new/payment/Apple_Pay.png", width: 40, height: 40),
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( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SvgPicture.asset('assets/images/new/not_found.svg', SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0),
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)))),
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 { Future navigateTo(context, page) async {
return await Navigator.push( return await Navigator.push(context, MaterialPageRoute(builder: (context) => page));
context, MaterialPageRoute(builder: (context) => page));
} }
// Future navigateToReplace(context, page) async { // Future navigateToReplace(context, page) async {
@ -147,11 +134,7 @@ Widget circularAviator(
child: Container( child: Container(
width: s, width: s,
height: s, height: s,
decoration: containerColorRadiusBorderWidth( decoration: containerColorRadiusBorderWidth(bcColor == null ? Colors.grey[200] : bcColor, 2000, brColor == null ? Colors.blueGrey[800] : brColor, borderWidth == null ? 2 : borderWidth),
bcColor == null ? Colors.grey[200] : bcColor,
2000,
brColor == null ? Colors.blueGrey[800] : brColor,
borderWidth == null ? 2 : borderWidth),
child: Icon( child: Icon(
icon == null ? Icons.person : icon, icon == null ? Icons.person : icon,
size: s / 1.7, size: s / 1.7,
@ -233,8 +216,7 @@ RoundedRectangleBorder buttonShape() {
); );
} }
Decoration containerRadiusWithGradient(double radius, Decoration containerRadiusWithGradient(double radius, {Color color1, Color color2}) {
{Color color1, Color color2}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.circular(radius), borderRadius: BorderRadius.circular(radius),
gradient: LinearGradient( gradient: LinearGradient(
@ -248,8 +230,7 @@ Decoration containerRadiusWithGradient(double radius,
); );
} }
Decoration containerBottomRightRadiusWithGradient(double radius, Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColor, Color lightColor}) {
{Color darkColor, Color lightColor}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)), borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)),
gradient: LinearGradient( gradient: LinearGradient(
@ -263,8 +244,7 @@ Decoration containerBottomRightRadiusWithGradient(double radius,
); );
} }
Decoration containerBottomRightRadiusWithGradientForAr(double radius, Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color darkColor, Color lightColor}) {
{Color darkColor, Color lightColor}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)), borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)),
gradient: LinearGradient( gradient: LinearGradient(
@ -307,11 +287,7 @@ Decoration containerRadiusWithGradientServices(
); );
} }
Decoration containerBottomRightRadiusWithGradientBorder(double radius, Decoration containerBottomRightRadiusWithGradientBorder(double radius, {Color darkColor, Color lightColor, Color borderColor = Colors.transparent, double w = 0}) {
{Color darkColor,
Color lightColor,
Color borderColor = Colors.transparent,
double w = 0}) {
return BoxDecoration( return BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(radius)), borderRadius: BorderRadius.all(Radius.circular(radius)),
border: Border.all( border: Border.all(
@ -332,6 +308,13 @@ Decoration containerBottomRightRadiusWithGradientBorder(double radius,
Decoration containerRadius(Color background, double radius) { Decoration containerRadius(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
border: Border.all( border: Border.all(
width: 1, // width: 1, //
color: background // <--- border width here color: background // <--- border width here
@ -340,8 +323,7 @@ Decoration containerRadius(Color background, double radius) {
); );
} }
Decoration containerColorRadiusBorder( Decoration containerColorRadiusBorder(Color background, double radius, Color color) {
Color background, double radius, Color color) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -352,8 +334,7 @@ Decoration containerColorRadiusBorder(
); );
} }
Decoration containerColorRadiusBorderWidth( Decoration containerColorRadiusBorderWidth(Color background, double radius, Color color, double w) {
Color background, double radius, Color color, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -364,8 +345,7 @@ Decoration containerColorRadiusBorderWidth(
); );
} }
Decoration containerColorRadiusBorderWidthCircular( Decoration containerColorRadiusBorderWidthCircular(Color background, double radius, Color color, double w) {
Color background, double radius, Color color, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -380,36 +360,29 @@ Decoration containerColorRadiusBorderWidthCircular(
Decoration containerColorRadiusRight(Color background, double radius) { Decoration containerColorRadiusRight(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)),
topRight: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
); );
} }
Decoration containerColorRadiusLeft(Color background, double radius) { Decoration containerColorRadiusLeft(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
); );
} }
Decoration containerColorRadiusRightBorder( Decoration containerColorRadiusRightBorder(Color background, double radius, double w) {
Color background, double radius, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
width: w, // width: w, //
color: Colors.white // <--- border width here color: Colors.white // <--- border width here
), ),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)),
topRight: Radius.circular(radius),
bottomRight: Radius.circular(radius)),
); );
} }
Decoration containerColorRadiusRightBorderc( Decoration containerColorRadiusRightBorderc(Color background, double radius, double w, Color borderColor) {
Color background, double radius, double w, Color borderColor) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
@ -440,16 +413,14 @@ Decoration containerColorRadiusBottom(Color color, double radius) {
); );
} }
Decoration containerColorRadiusLeftBorder( Decoration containerColorRadiusLeftBorder(Color background, double radius, double w) {
Color background, double radius, double w) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,
border: Border.all( border: Border.all(
width: w, // width: w, //
color: Colors.white // <--- border width here color: Colors.white // <--- border width here
), ),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)),
); );
} }
@ -481,23 +452,19 @@ ShapeBorder cardRadiusNew(double radius) {
ShapeBorder cardRadiusTop(double radius) { ShapeBorder cardRadiusTop(double radius) {
return RoundedRectangleBorder( return RoundedRectangleBorder(
side: BorderSide(color: Colors.transparent, width: 0), side: BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
); );
} }
ShapeBorder cardRadiusTop2(double radius) { ShapeBorder cardRadiusTop2(double radius) {
return RoundedRectangleBorder( return RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
topLeft: Radius.circular(radius), topRight: Radius.circular(radius)),
); );
} }
ShapeBorder cardRadiusBottom(double radius) { ShapeBorder cardRadiusBottom(double radius) {
return RoundedRectangleBorder( return RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius), bottomRight: Radius.circular(radius)),
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) { bool timeCalculator(int startHour, int startMint, int endHour, int endMint) {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTime startDate = DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour);
DateTime(now.year, now.month, now.day, startHour, startHour);
DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint);
if (startDate.isBefore(now) && endDate.isAfter(now)) if (startDate.isBefore(now) && endDate.isAfter(now))
return true; return true;

Loading…
Cancel
Save