|
|
|
@ -29,26 +29,22 @@ import '../../../../new_views/common_widgets/app_filled_button.dart';
|
|
|
|
import '../../../../new_views/common_widgets/app_text_form_field.dart';
|
|
|
|
import '../../../../new_views/common_widgets/app_text_form_field.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class ServiceRequestBottomSheet {
|
|
|
|
class ServiceRequestBottomSheet {
|
|
|
|
static Future fixRemotelyBottomSheet({required BuildContext context}) {
|
|
|
|
static buildBottomSheetParentWithConsumer({required BuildContext context, required Widget childWidget}) {
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
useSafeArea: true,
|
|
|
|
useSafeArea: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
builder: (context) => SingleChildScrollView(
|
|
|
|
return Container(
|
|
|
|
child: childWidget,
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
).bottomSheetContainer(context),
|
|
|
|
margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
);
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
}
|
|
|
|
color: AppColor.background(context),
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
|
|
|
|
static Future fixRemotelyBottomSheet({required BuildContext context}) {
|
|
|
|
),
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
|
|
|
|
context: context,
|
|
|
|
child: Form(
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
key: _formKey,
|
|
|
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
|
|
|
child: StatefulBuilder(builder: (context, setState) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -86,11 +82,9 @@ class ServiceRequestBottomSheet {
|
|
|
|
"Visit Date time must be greater then request date".showToast;
|
|
|
|
"Visit Date time must be greater then request date".showToast;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.startDate = selectedDateTime.toIso8601String();
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.startDate = selectedDateTime.toIso8601String();
|
|
|
|
});
|
|
|
|
serviceRequestProvider.updateCurrentSelectedRequest(serviceRequestProvider.currentSelectedRequest);
|
|
|
|
print('start date i got is ${serviceRequestProvider.currentSelectedRequest?.startDate}');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -165,14 +159,283 @@ class ServiceRequestBottomSheet {
|
|
|
|
16.height,
|
|
|
|
16.height,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}));
|
|
|
|
|
|
|
|
// showModalBottomSheet(
|
|
|
|
|
|
|
|
// context: context,
|
|
|
|
|
|
|
|
// useSafeArea: true,
|
|
|
|
|
|
|
|
// isScrollControlled: true,
|
|
|
|
|
|
|
|
// backgroundColor: Colors.transparent,
|
|
|
|
|
|
|
|
// builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
// return Form(
|
|
|
|
|
|
|
|
// key: _formKey,
|
|
|
|
|
|
|
|
// child: SingleChildScrollView(
|
|
|
|
|
|
|
|
// child: StatefulBuilder(builder: (context, setState) {
|
|
|
|
|
|
|
|
// return Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
// 16.height,
|
|
|
|
|
|
|
|
// Align(
|
|
|
|
|
|
|
|
// alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
// child: context.translation.fillDetails.bottomSheetHeadingTextStyle(context),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 16.height,
|
|
|
|
|
|
|
|
// ADatePicker(
|
|
|
|
|
|
|
|
// label: context.translation.date,
|
|
|
|
|
|
|
|
// hideShadow: true,
|
|
|
|
|
|
|
|
// // height: 60.toScreenHeight,
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.neutral100,
|
|
|
|
|
|
|
|
// date: DateTime.tryParse(serviceRequestProvider.currentSelectedRequest?.startDate ?? ""),
|
|
|
|
|
|
|
|
// formatDateWithTime: true,
|
|
|
|
|
|
|
|
// onDatePicker: (selectedDate) {
|
|
|
|
|
|
|
|
// if (selectedDate != null) {
|
|
|
|
|
|
|
|
// showTimePicker(
|
|
|
|
|
|
|
|
// context: context,
|
|
|
|
|
|
|
|
// initialTime: TimeOfDay.now(),
|
|
|
|
|
|
|
|
// ).then((selectedTime) {
|
|
|
|
|
|
|
|
// // Handle the selected date and time here.
|
|
|
|
|
|
|
|
// if (selectedTime != null) {
|
|
|
|
|
|
|
|
// DateTime selectedDateTime = DateTime(
|
|
|
|
|
|
|
|
// selectedDate.year,
|
|
|
|
|
|
|
|
// selectedDate.month,
|
|
|
|
|
|
|
|
// selectedDate.day,
|
|
|
|
|
|
|
|
// selectedTime.hour,
|
|
|
|
|
|
|
|
// selectedTime.minute,
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// //serviceRequestProvider.currentSelectedRequest?.date
|
|
|
|
|
|
|
|
// if (selectedDateTime.isBefore(DateTime.parse(serviceRequestProvider.currentSelectedRequest!.date!))) {
|
|
|
|
|
|
|
|
// "Visit Date time must be greater then request date".showToast;
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// serviceRequestProvider.currentSelectedRequest?.startDate = selectedDateTime.toIso8601String();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// print('start date i got is ${serviceRequestProvider.currentSelectedRequest?.startDate}');
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 8.height,
|
|
|
|
|
|
|
|
// SizedBox(
|
|
|
|
|
|
|
|
// width: double.infinity,
|
|
|
|
|
|
|
|
// height: 56.toScreenHeight,
|
|
|
|
|
|
|
|
// // padding: EdgeInsets.symmetric(horizontal: 20.toScreenWidth, vertical: 10.toScreenHeight),
|
|
|
|
|
|
|
|
// child: AppTimer(
|
|
|
|
|
|
|
|
// label: context.translation.workingHours,
|
|
|
|
|
|
|
|
// timer: TimerModel(),
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// color: context.isDark ? AppColor.neutral20 : AppColor.neutral100,
|
|
|
|
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
// // boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// // enabled: serviceRequestProvider.currentSelectedRequest.date == null,
|
|
|
|
|
|
|
|
// enabled: true,
|
|
|
|
|
|
|
|
// onChange: (timer) async {
|
|
|
|
|
|
|
|
// print('timer i got is ${timer.toString()}');
|
|
|
|
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 8.height,
|
|
|
|
|
|
|
|
// AppTextFormField(
|
|
|
|
|
|
|
|
// labelText: context.translation.comments,
|
|
|
|
|
|
|
|
// textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
// labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
// showWithoutDecoration: true,
|
|
|
|
|
|
|
|
// backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral100,
|
|
|
|
|
|
|
|
// alignLabelWithHint: true,
|
|
|
|
|
|
|
|
// onChange: (text) {
|
|
|
|
|
|
|
|
// serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onSaved: (text) {
|
|
|
|
|
|
|
|
// serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 16.height,
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// SizedBox(
|
|
|
|
|
|
|
|
// width: 200.toScreenHeight,
|
|
|
|
|
|
|
|
// child: AppFilledButton(
|
|
|
|
|
|
|
|
// label: context.translation.cancel,
|
|
|
|
|
|
|
|
// loading: false,
|
|
|
|
|
|
|
|
// buttonColor: Colors.transparent,
|
|
|
|
|
|
|
|
// showBorder: true,
|
|
|
|
|
|
|
|
// textColor: AppColor.black20,
|
|
|
|
|
|
|
|
// onPressed: () async {
|
|
|
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
|
|
|
// // await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.serviceRequest);
|
|
|
|
|
|
|
|
// // Navigator.pop(context, true);
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// SizedBox(
|
|
|
|
|
|
|
|
// width: 200.toScreenHeight,
|
|
|
|
|
|
|
|
// child: AppFilledButton(
|
|
|
|
|
|
|
|
// label: context.translation.fixed,
|
|
|
|
|
|
|
|
// buttonColor: AppColor.green70,
|
|
|
|
|
|
|
|
// loading: false,
|
|
|
|
|
|
|
|
// onPressed: () {},
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 16.height,
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// }),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ).bottomSheetContainer(context);
|
|
|
|
|
|
|
|
// }));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static Future initialVisitBottomSheet({required BuildContext context}) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Align(
|
|
|
|
|
|
|
|
alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
child: context.translation.setVisitDate.bottomSheetHeadingTextStyle(context),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
15.height,
|
|
|
|
|
|
|
|
ADatePicker(
|
|
|
|
|
|
|
|
label: context.translation.visitDate,
|
|
|
|
|
|
|
|
hideShadow: true,
|
|
|
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
|
|
|
date: DateTime.tryParse(serviceRequestProvider.currentSelectedRequest?.visitDate ?? ""),
|
|
|
|
|
|
|
|
formatDateWithTime: true,
|
|
|
|
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
|
|
|
|
if (selectedDate != null) {
|
|
|
|
|
|
|
|
showTimePicker(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
|
|
|
|
).then((selectedTime) {
|
|
|
|
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
|
|
|
|
if (selectedTime != null) {
|
|
|
|
|
|
|
|
DateTime selectedDateTime = DateTime(
|
|
|
|
|
|
|
|
selectedDate.year,
|
|
|
|
|
|
|
|
selectedDate.month,
|
|
|
|
|
|
|
|
selectedDate.day,
|
|
|
|
|
|
|
|
selectedTime.hour,
|
|
|
|
|
|
|
|
selectedTime.minute,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (selectedDateTime.isBefore(DateTime.parse(serviceRequestProvider.currentSelectedRequest!.date!))) {
|
|
|
|
|
|
|
|
"Visit Date time must be greater then request date".showToast;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.visitDate = selectedDateTime?.toIso8601String();
|
|
|
|
|
|
|
|
serviceRequestProvider.updateCurrentSelectedRequest(serviceRequestProvider.currentSelectedRequest);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
if (serviceRequestProvider.currentSelectedRequest?.firstAction?.id == 404 && Provider.of<SettingProvider>(context, listen: false).assetGroup?.id == 1) ...[
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
ADatePicker(
|
|
|
|
|
|
|
|
label: context.translation.startDate,
|
|
|
|
|
|
|
|
date: DateTime.tryParse(serviceRequestProvider.currentSelectedRequest?.startDate ?? ""),
|
|
|
|
|
|
|
|
formatDateWithTime: true,
|
|
|
|
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
|
|
|
|
if (selectedDate != null) {
|
|
|
|
|
|
|
|
showTimePicker(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
|
|
|
|
).then((selectedTime) {
|
|
|
|
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
|
|
|
|
if (selectedTime != null) {
|
|
|
|
|
|
|
|
DateTime selectedDateTime = DateTime(
|
|
|
|
|
|
|
|
selectedDate.year,
|
|
|
|
|
|
|
|
selectedDate.month,
|
|
|
|
|
|
|
|
selectedDate.day,
|
|
|
|
|
|
|
|
selectedTime.hour,
|
|
|
|
|
|
|
|
selectedTime.minute,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}));
|
|
|
|
if (selectedDateTime != null) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.startDate = selectedDateTime?.toIso8601String();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
8.width,
|
|
|
|
|
|
|
|
ADatePicker(
|
|
|
|
|
|
|
|
label: context.translation.endDate,
|
|
|
|
|
|
|
|
date: DateTime.tryParse(serviceRequestProvider.currentSelectedRequest?.endDate ?? ""),
|
|
|
|
|
|
|
|
formatDateWithTime: true,
|
|
|
|
|
|
|
|
onDatePicker: (selectedDate) {
|
|
|
|
|
|
|
|
showTimePicker(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
initialTime: TimeOfDay.now(),
|
|
|
|
|
|
|
|
).then((selectedTime) {
|
|
|
|
|
|
|
|
// Handle the selected date and time here.
|
|
|
|
|
|
|
|
if (selectedTime != null) {
|
|
|
|
|
|
|
|
DateTime selectedDateTime = DateTime(
|
|
|
|
|
|
|
|
selectedDate.year,
|
|
|
|
|
|
|
|
selectedDate.month,
|
|
|
|
|
|
|
|
selectedDate.day,
|
|
|
|
|
|
|
|
selectedTime.hour,
|
|
|
|
|
|
|
|
selectedTime.minute,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.endDate = selectedDateTime?.toIso8601String();
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.workingHours = (((DateTime.parse(serviceRequestProvider.currentSelectedRequest!.endDate!)
|
|
|
|
|
|
|
|
.difference(DateTime.parse(serviceRequestProvider.currentSelectedRequest!.startDate!))
|
|
|
|
|
|
|
|
.inSeconds ??
|
|
|
|
|
|
|
|
0) /
|
|
|
|
|
|
|
|
60) /
|
|
|
|
|
|
|
|
60)
|
|
|
|
|
|
|
|
.toStringAsFixed(2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
|
|
|
labelText: context.translation.comments,
|
|
|
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
showShadow: false,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onSaved: (text) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.save,
|
|
|
|
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
|
|
|
|
loading: serviceRequestProvider.isLoading ?? false,
|
|
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
// formKey.currentState?.save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.serviceRequest);
|
|
|
|
|
|
|
|
// Navigator.pop(context, true);
|
|
|
|
|
|
|
|
Navigator.of(context).push(MaterialPageRoute(builder: (_) => VerifyArrivalView()));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
16.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
static Future initialVisitBottomSheet({required BuildContext context}) {
|
|
|
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
@ -325,6 +588,68 @@ class ServiceRequestBottomSheet {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Future rejectRequestBottomSheet({required BuildContext context}) {
|
|
|
|
static Future rejectRequestBottomSheet({required BuildContext context}) {
|
|
|
|
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
Align(
|
|
|
|
|
|
|
|
alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
child: context.translation.rejectionReason.heading4(context).paddingOnly(top: 21),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
15.height,
|
|
|
|
|
|
|
|
SingleItemDropDownMenu<Lookup, FirstActionStatusProvider>(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
|
|
|
height: 56.toScreenHeight,
|
|
|
|
|
|
|
|
title: context.translation.reason,
|
|
|
|
|
|
|
|
initialValue: serviceRequestProvider.currentSelectedRequest?.firstAction,
|
|
|
|
|
|
|
|
//_serviceRequest.firstAction,
|
|
|
|
|
|
|
|
onSelect: (value) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.firstAction = value;
|
|
|
|
|
|
|
|
if (serviceRequestProvider.currentSelectedRequest?.firstAction?.value != 2) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.visitDate = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.height,
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
|
|
|
labelText: context.translation.comments,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onSaved: (text) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
16.height,
|
|
|
|
|
|
|
|
Consumer<ServiceRequestsProvider>(
|
|
|
|
|
|
|
|
builder: (context, snapshot, _) => AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.reject,
|
|
|
|
|
|
|
|
maxWidth: true,
|
|
|
|
|
|
|
|
buttonColor: Colors.white54,
|
|
|
|
|
|
|
|
textColor: AppColor.red30,
|
|
|
|
|
|
|
|
showBorder: true,
|
|
|
|
|
|
|
|
loading: snapshot.isLoading ?? false,
|
|
|
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Todo implement backend logic..
|
|
|
|
|
|
|
|
// serviceRequestProvider.serviceRequest.device = asset;
|
|
|
|
|
|
|
|
// await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.currentSelectedRequest);
|
|
|
|
|
|
|
|
Navigator.pop(context, true);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
16.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
@ -381,7 +706,7 @@ class ServiceRequestBottomSheet {
|
|
|
|
showBorder: true,
|
|
|
|
showBorder: true,
|
|
|
|
loading: snapshot.isLoading ?? false,
|
|
|
|
loading: snapshot.isLoading ?? false,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
_formKey.currentState?.save();
|
|
|
|
|
|
|
|
//Todo implement backend logic..
|
|
|
|
//Todo implement backend logic..
|
|
|
|
// serviceRequestProvider.serviceRequest.device = asset;
|
|
|
|
// serviceRequestProvider.serviceRequest.device = asset;
|
|
|
|
// await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.currentSelectedRequest);
|
|
|
|
// await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.currentSelectedRequest);
|
|
|
|
@ -441,23 +766,41 @@ class ServiceRequestBottomSheet {
|
|
|
|
// MaterialPageRoute(builder: (context) => ActivitiesListView()),
|
|
|
|
// MaterialPageRoute(builder: (context) => ActivitiesListView()),
|
|
|
|
// );
|
|
|
|
// );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
//push to specific screen...
|
|
|
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
|
|
|
// context,
|
|
|
|
|
|
|
|
// MaterialPageRoute(builder: (context) => const ScanQrView()),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
//push to specific screen...
|
|
|
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
|
|
|
// context,
|
|
|
|
|
|
|
|
// MaterialPageRoute(builder: (context) => const ScanQrView()),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ScanQr
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Align(
|
|
|
|
|
|
|
|
alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
child: context.translation.selectActivityType.bottomSheetHeadingTextStyle(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
16.height,
|
|
|
|
|
|
|
|
ListView.builder(
|
|
|
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
itemCount: items.length,
|
|
|
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
|
|
|
final item = items[index];
|
|
|
|
|
|
|
|
return listItem(
|
|
|
|
|
|
|
|
icon: item['icon']!,
|
|
|
|
|
|
|
|
heading: item['heading']!,
|
|
|
|
|
|
|
|
subHeading: item['subHeading']!,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
onItemTap(serviceRequest: serviceRequestProvider.currentSelectedRequest!, index: index, context: context);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
@ -465,15 +808,7 @@ class ServiceRequestBottomSheet {
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
return Container(
|
|
|
|
return Column(
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: AppColor.background(context),
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
@ -500,27 +835,60 @@ class ServiceRequestBottomSheet {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
).bottomSheetContainer(context);
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Future actionBottomSheet({required BuildContext context, required String title, String? button1Text, String? button2Text, VoidCallback? button1Tap, VoidCallback? button2Tap}) {
|
|
|
|
static Future actionBottomSheet({required BuildContext context, required String title, String? button1Text, String? button2Text, VoidCallback? button1Tap, VoidCallback? button2Tap}) {
|
|
|
|
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Align(
|
|
|
|
|
|
|
|
alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
child: title.bottomSheetHeadingTextStyle(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
41.height,
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: button1Text ?? context.translation.no,
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
buttonColor: AppColor.white60,
|
|
|
|
|
|
|
|
textColor: AppColor.black10,
|
|
|
|
|
|
|
|
onPressed: button1Tap ??
|
|
|
|
|
|
|
|
() async {
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
// await snapshot.updateRequest(user: userProvider.user, request: serviceRequestProvider.serviceRequest);
|
|
|
|
|
|
|
|
// Navigator.pop(context, true);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
12.width,
|
|
|
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.yes,
|
|
|
|
|
|
|
|
buttonColor: AppColor.primary10,
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
onPressed: button2Tap,
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
useSafeArea: true,
|
|
|
|
useSafeArea: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
return Container(
|
|
|
|
return Column(
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 12.toScreenHeight),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
@ -555,29 +923,58 @@ class ServiceRequestBottomSheet {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
).bottomSheetContainer(context);
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Future feedBackBottomSheet({required BuildContext context}) {
|
|
|
|
static Future feedBackBottomSheet({required BuildContext context}) {
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
|
|
|
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
Align(
|
|
|
|
|
|
|
|
alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
child: context.translation.feedBack.bottomSheetHeadingTextStyle(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
21.height,
|
|
|
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
|
|
|
labelText: context.translation.comments,
|
|
|
|
|
|
|
|
textInputType: TextInputType.multiline,
|
|
|
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
|
|
|
showWithoutDecoration: true,
|
|
|
|
|
|
|
|
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral100,
|
|
|
|
|
|
|
|
alignLabelWithHint: true,
|
|
|
|
|
|
|
|
onChange: (text) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onSaved: (text) {
|
|
|
|
|
|
|
|
serviceRequestProvider.currentSelectedRequest?.comments = text;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
16.height,
|
|
|
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
|
|
|
label: context.translation.fixed,
|
|
|
|
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
useSafeArea: true,
|
|
|
|
useSafeArea: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
return Container(
|
|
|
|
return Form(
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
// key: _formKey,
|
|
|
|
margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: AppColor.background(context),
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.only(topRight: Radius.circular(20), topLeft: Radius.circular(20)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
|
|
|
|
|
|
|
|
child: Form(
|
|
|
|
|
|
|
|
key: _formKey,
|
|
|
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: StatefulBuilder(builder: (context, setState) {
|
|
|
|
child: StatefulBuilder(builder: (context, setState) {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
@ -615,27 +1012,17 @@ class ServiceRequestBottomSheet {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)..bottomSheetContainer(context);
|
|
|
|
);
|
|
|
|
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static Future nurseTakeActionBottomSheet({required BuildContext context}) {
|
|
|
|
static Future nurseTakeActionBottomSheet({required BuildContext context}) {
|
|
|
|
bool acknowledge = false;
|
|
|
|
bool acknowledge = false;
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
|
|
|
Uint8List? newSignature;
|
|
|
|
Uint8List? newSignature;
|
|
|
|
String ?nurseSignature;
|
|
|
|
String? nurseSignature;
|
|
|
|
return showModalBottomSheet(
|
|
|
|
return buildBottomSheetParentWithConsumer(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
useSafeArea: true,
|
|
|
|
childWidget: Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
|
|
|
|
builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
return Form(
|
|
|
|
|
|
|
|
key: _formKey,
|
|
|
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
|
|
|
child: StatefulBuilder(builder: (context, setState) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -654,14 +1041,12 @@ class ServiceRequestBottomSheet {
|
|
|
|
Icons.check_box,
|
|
|
|
Icons.check_box,
|
|
|
|
color: AppColor.primary10,
|
|
|
|
color: AppColor.primary10,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
:const Icon(
|
|
|
|
: const Icon(
|
|
|
|
Icons.check_box_outline_blank,
|
|
|
|
Icons.check_box_outline_blank,
|
|
|
|
color: AppColor.neutral120,
|
|
|
|
color: AppColor.neutral120,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
acknowledge = !acknowledge;
|
|
|
|
acknowledge = !acknowledge;
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
6.width,
|
|
|
|
6.width,
|
|
|
|
@ -693,17 +1078,15 @@ class ServiceRequestBottomSheet {
|
|
|
|
textColor: AppColor.red30,
|
|
|
|
textColor: AppColor.red30,
|
|
|
|
showBorder: true,
|
|
|
|
showBorder: true,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
_formKey.currentState?.save();
|
|
|
|
if (newSignature != null && acknowledge) {
|
|
|
|
if(newSignature!=null&&acknowledge){
|
|
|
|
|
|
|
|
//TODO replace provider with new provider and also check workorder id is not correct.
|
|
|
|
//TODO replace provider with new provider and also check workorder id is not correct.
|
|
|
|
Provider.of<RequestDetailProvider>(context,listen: false).nurseReject(model: NurseActionModel(
|
|
|
|
Provider.of<RequestDetailProvider>(context, listen: false).nurseReject(
|
|
|
|
|
|
|
|
model: NurseActionModel(
|
|
|
|
workOrderId: int.parse(serviceRequestProvider.currentSelectedRequest!.id!),
|
|
|
|
workOrderId: int.parse(serviceRequestProvider.currentSelectedRequest!.id!),
|
|
|
|
signatureNurse: nurseSignature,
|
|
|
|
signatureNurse: nurseSignature,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
@ -714,10 +1097,10 @@ class ServiceRequestBottomSheet {
|
|
|
|
maxWidth: true,
|
|
|
|
maxWidth: true,
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
buttonColor: AppColor.green70,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
_formKey.currentState?.save();
|
|
|
|
if (newSignature != null && acknowledge) {
|
|
|
|
if(newSignature!=null&&acknowledge){
|
|
|
|
|
|
|
|
//TODO replace provider with new provider and also check workorder id is not correct.
|
|
|
|
//TODO replace provider with new provider and also check workorder id is not correct.
|
|
|
|
Provider.of<RequestDetailProvider>(context,listen: false).nurseConfirm(model: NurseActionModel(
|
|
|
|
Provider.of<RequestDetailProvider>(context, listen: false).nurseConfirm(
|
|
|
|
|
|
|
|
model: NurseActionModel(
|
|
|
|
workOrderId: int.parse(serviceRequestProvider.currentSelectedRequest!.id!),
|
|
|
|
workOrderId: int.parse(serviceRequestProvider.currentSelectedRequest!.id!),
|
|
|
|
signatureNurse: nurseSignature,
|
|
|
|
signatureNurse: nurseSignature,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
@ -729,9 +1112,115 @@ class ServiceRequestBottomSheet {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
).bottomSheetContainer(context);
|
|
|
|
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// return showModalBottomSheet(
|
|
|
|
|
|
|
|
// context: context,
|
|
|
|
|
|
|
|
// useSafeArea: true,
|
|
|
|
|
|
|
|
// isScrollControlled: true,
|
|
|
|
|
|
|
|
// backgroundColor: Colors.transparent,
|
|
|
|
|
|
|
|
// builder: (context) => Consumer<ServiceRequestsProvider>(builder: (context, serviceRequestProvider, child) {
|
|
|
|
|
|
|
|
// return Form(
|
|
|
|
|
|
|
|
// key: _formKey,
|
|
|
|
|
|
|
|
// child: SingleChildScrollView(
|
|
|
|
|
|
|
|
// child: StatefulBuilder(builder: (context, setState) {
|
|
|
|
|
|
|
|
// return Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// const SizedBox().indicatorWidget(),
|
|
|
|
|
|
|
|
// 8.height,
|
|
|
|
|
|
|
|
// Align(
|
|
|
|
|
|
|
|
// alignment: AlignmentDirectional.centerStart,
|
|
|
|
|
|
|
|
// child: context.translation.pleaseConfirmTheIssueHasBeenResolved.bottomSheetHeadingTextStyle(context),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 10.height,
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// InkWell(
|
|
|
|
|
|
|
|
// child: acknowledge
|
|
|
|
|
|
|
|
// ? const Icon(
|
|
|
|
|
|
|
|
// Icons.check_box,
|
|
|
|
|
|
|
|
// color: AppColor.primary10,
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// : const Icon(
|
|
|
|
|
|
|
|
// Icons.check_box_outline_blank,
|
|
|
|
|
|
|
|
// color: AppColor.neutral120,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// onTap: () {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// acknowledge = !acknowledge;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 6.width,
|
|
|
|
|
|
|
|
// Flexible(child: context.translation.nurseAcknowledge.bodyText(context).custom(color: context.isDark ? AppColor.primary50 : AppColor.neutral120)),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 17.height,
|
|
|
|
|
|
|
|
// ESignature(
|
|
|
|
|
|
|
|
// title: '',
|
|
|
|
|
|
|
|
// oldSignature: '',
|
|
|
|
|
|
|
|
// newSignature: newSignature,
|
|
|
|
|
|
|
|
// backgroundColor: AppColor.neutral100,
|
|
|
|
|
|
|
|
// showShadow: false,
|
|
|
|
|
|
|
|
// onSaved: (signature) {
|
|
|
|
|
|
|
|
// if (signature == null || signature.isEmpty) return;
|
|
|
|
|
|
|
|
// newSignature = signature;
|
|
|
|
|
|
|
|
// nurseSignature = "${DateTime.now().toIso8601String()}.png|${base64Encode(signature)}";
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 36.height,
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// AppFilledButton(
|
|
|
|
|
|
|
|
// label: context.translation.reject,
|
|
|
|
|
|
|
|
// maxWidth: true,
|
|
|
|
|
|
|
|
// buttonColor: Colors.white54,
|
|
|
|
|
|
|
|
// textColor: AppColor.red30,
|
|
|
|
|
|
|
|
// showBorder: true,
|
|
|
|
|
|
|
|
// onPressed: () async {
|
|
|
|
|
|
|
|
// _formKey.currentState?.save();
|
|
|
|
|
|
|
|
// if (newSignature != null && acknowledge) {
|
|
|
|
|
|
|
|
// //TODO replace provider with new provider and also check workorder id is not correct.
|
|
|
|
|
|
|
|
// Provider.of<RequestDetailProvider>(context, listen: false).nurseReject(
|
|
|
|
|
|
|
|
// model: NurseActionModel(
|
|
|
|
|
|
|
|
// workOrderId: int.parse(serviceRequestProvider.currentSelectedRequest!.id!),
|
|
|
|
|
|
|
|
// signatureNurse: nurseSignature,
|
|
|
|
|
|
|
|
// ));
|
|
|
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ).expanded,
|
|
|
|
|
|
|
|
// const SizedBox(
|
|
|
|
|
|
|
|
// width: 20,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// AppFilledButton(
|
|
|
|
|
|
|
|
// label: context.translation.confirm,
|
|
|
|
|
|
|
|
// maxWidth: true,
|
|
|
|
|
|
|
|
// buttonColor: AppColor.green70,
|
|
|
|
|
|
|
|
// onPressed: () async {
|
|
|
|
|
|
|
|
// _formKey.currentState?.save();
|
|
|
|
|
|
|
|
// if (newSignature != null && acknowledge) {
|
|
|
|
|
|
|
|
// //TODO replace provider with new provider and also check workorder id is not correct.
|
|
|
|
|
|
|
|
// Provider.of<RequestDetailProvider>(context, listen: false).nurseConfirm(
|
|
|
|
|
|
|
|
// model: NurseActionModel(
|
|
|
|
|
|
|
|
// workOrderId: int.parse(serviceRequestProvider.currentSelectedRequest!.id!),
|
|
|
|
|
|
|
|
// signatureNurse: nurseSignature,
|
|
|
|
|
|
|
|
// ));
|
|
|
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ).expanded,
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// }),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ).bottomSheetContainer(context);
|
|
|
|
|
|
|
|
// }));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|