1.3.6+25 merge conflict resolved.

design_3.0_TM_Module_snagsFix
Sikander Saleem 3 months ago
parent 47673e3473
commit 1edcea47be

@ -117,9 +117,11 @@ class _PpmDetailsPageState extends State<PpmDetailsPage> {
}, },
label: context.translation.updateWorkOrder, label: context.translation.updateWorkOrder,
), ),
context: context,
) )
] else ...[ ] else ...[
FooterActionButton.footerContainer( FooterActionButton.footerContainer(
context: context,
child: AppFilledButton( child: AppFilledButton(
onPressed: () async { onPressed: () async {
await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdatePpm(ppm: null, planPreventiveVisit: planPreventiveVisit))); await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdatePpm(ppm: null, planPreventiveVisit: planPreventiveVisit)));

@ -48,9 +48,8 @@ class _UpdatePpmState extends State<UpdatePpm> with TickerProviderStateMixin {
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
ppmProvider.planPreventiveVisit?.preventiveVisitAttachments = []; ppmProvider.planPreventiveVisit?.preventiveVisitAttachments = [];
for (var item in ppmProvider.ppmPlanAttachments) { for (var item in ppmProvider.ppmPlanAttachments) {
String fileName = ServiceRequestUtils.isLocalUrl(item.name??'') ? ("${item.name??''.split("/").last}|${base64Encode(File(item.name??'').readAsBytesSync())}") :item.name??''; String fileName = ServiceRequestUtils.isLocalUrl(item.name ?? '') ? ("${item.name ?? ''.split("/").last}|${base64Encode(File(item.name ?? '').readAsBytesSync())}") : item.name ?? '';
ppmProvider.planPreventiveVisit?.preventiveVisitAttachments ppmProvider.planPreventiveVisit?.preventiveVisitAttachments?.add(PreventiveVisitAttachments(id: item.id, attachmentName: fileName));
?.add(PreventiveVisitAttachments(id: item.id, attachmentName: fileName));
} }
ppmProvider.planPreventiveVisit?.preventiveVisitTimers = ppmProvider.planPreventiveVisit?.preventiveVisitTimers ?? []; ppmProvider.planPreventiveVisit?.preventiveVisitTimers = ppmProvider.planPreventiveVisit?.preventiveVisitTimers ?? [];
@ -202,6 +201,7 @@ class _UpdatePpmState extends State<UpdatePpm> with TickerProviderStateMixin {
), ),
).expanded, ).expanded,
FooterActionButton.footerContainer( FooterActionButton.footerContainer(
context: context,
child: Row( child: Row(
children: [ children: [
if (tabIndex == 1) ...[ if (tabIndex == 1) ...[
@ -227,8 +227,8 @@ class _UpdatePpmState extends State<UpdatePpm> with TickerProviderStateMixin {
AppFilledButton( AppFilledButton(
// buttonColor: AppColor.white60, // buttonColor: AppColor.white60,
// textColor: AppColor.neutral50, // textColor: AppColor.neutral50,
buttonColor: context.isDark?AppColor.neutral50:AppColor.white60, buttonColor: context.isDark ? AppColor.neutral50 : AppColor.white60,
textColor: context.isDark ? Colors.white: AppColor.neutral150, textColor: context.isDark ? Colors.white : AppColor.neutral150,
onPressed: () { onPressed: () {
_onSubmit(status: 0); _onSubmit(status: 0);
}, },

@ -146,6 +146,7 @@ class _TaskRequestDetailsViewState extends State<TaskRequestDetailsView> {
).expanded, ).expanded,
if (userProvider!.user!.type == UsersTypes.engineer && (taskModel?.taskJobStatus?.value != 4 && taskModel?.taskJobStatus?.value != 3)) if (userProvider!.user!.type == UsersTypes.engineer && (taskModel?.taskJobStatus?.value != 4 && taskModel?.taskJobStatus?.value != 3))
FooterActionButton.footerContainer( FooterActionButton.footerContainer(
context: context,
child: AppFilledButton( child: AppFilledButton(
onPressed: () async { onPressed: () async {
if (taskProvider.taskRequestModel?.taskType?.isInstallation == true) { if (taskProvider.taskRequestModel?.taskType?.isInstallation == true) {

@ -75,6 +75,7 @@ class _GasRefillDetailsPageState extends State<GasRefillDetailsPage> {
).expanded, ).expanded,
if (_userProvider.user!.type == UsersTypes.engineer && (_model.status!.value! != 2)) ...[ if (_userProvider.user!.type == UsersTypes.engineer && (_model.status!.value! != 2)) ...[
FooterActionButton.footerContainer( FooterActionButton.footerContainer(
context: context,
child: AppFilledButton( child: AppFilledButton(
onPressed: () async { onPressed: () async {
await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateGasRefillRequest(gasRefillModel: _model))); await Navigator.of(context).push(MaterialPageRoute(builder: (_) => UpdateGasRefillRequest(gasRefillModel: _model)));

@ -147,7 +147,7 @@ class _SelectionBottomSheetState<T> extends State<SelectionFullScreenDialog<T>>
Navigator.pop(context); Navigator.pop(context);
widget.onSelect(_selectedValue); widget.onSelect(_selectedValue);
}, },
), ), context: context,
), ),
], ],
), ),

@ -339,7 +339,7 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
); );
if (result != null) { if (result != null) {
for (var path in result.paths) { for (var path in result.paths) {
widget.attachment.add(GenericAttachmentModel(id: 0,name: File(path!).path)); widget.attachment.add(GenericAttachmentModel(id: 0, name: File(path!).path));
} }
if (widget.onChange != null) { if (widget.onChange != null) {
widget.onChange!(widget.attachment); widget.onChange!(widget.attachment);
@ -347,8 +347,12 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
setState(() {}); setState(() {});
} }
} }
}
void showFileSourceSheet() async {
if (widget.attachment.length >= 5) {
Fluttertoast.showToast(msg: context.translation.maxImagesNumberIs5);
return;
}
ImageSource source = (await showModalBottomSheet( ImageSource source = (await showModalBottomSheet(
context: context, context: context,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
@ -386,7 +390,7 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
if (pickedFile != null) { if (pickedFile != null) {
File fileImage = File(pickedFile.path); File fileImage = File(pickedFile.path);
widget.attachment.add(GenericAttachmentModel(id: 0,name: fileImage.path)); widget.attachment.add(GenericAttachmentModel(id: 0, name: fileImage.path));
if (widget.onChange != null) { if (widget.onChange != null) {
widget.onChange!(widget.attachment); widget.onChange!(widget.attachment);
} }
@ -476,32 +480,7 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
); );
}, },
); );
// ImageSource source = await showDialog(
// context: context,
// builder: (dialogContext) => CupertinoAlertDialog(
// actions: <Widget>[
// TextButton(
// child: Text(context.translation.pickFromCamera),
// onPressed: () {
// Navigator.of(dialogContext).pop(ImageSource.camera);
// },
// ),
// TextButton(
// child: Text(context.translation.pickFromGallery),
// onPressed: () {
// Navigator.of(dialogContext).pop(ImageSource.gallery);
// },
// ),
// TextButton(
// child: Text(context.translation.pickFromFiles),
// onPressed: () async {
// await fromFilePicker();
// Navigator.pop(context);
// },
// ),
// ],
// ),
// );
if (source == null) return; if (source == null) return;
final pickedFile = await ImagePicker().pickImage(source: source, imageQuality: 70, maxWidth: 800, maxHeight: 800); final pickedFile = await ImagePicker().pickImage(source: source, imageQuality: 70, maxWidth: 800, maxHeight: 800);

Loading…
Cancel
Save