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

@ -60,84 +60,82 @@ class _AssetRetiredState extends State<AssetRetired> with TickerProviderStateMix
key: _scaffoldKey,
appBar: DefaultAppBar(title: context.translation.assetToBeRetired),
body: Consumer<ServiceRequestDetailProvider>(builder: (context, ServiceRequestDetailProvider requestDetailProvider, child) {
return SafeArea(
child: LoadingManager(
isLoading: _isLoading,
isFailedLoading: false,
stateCode: 200,
onRefresh: () async {},
child: Form(
key: _formKey,
child: Column(
children: [
SingleChildScrollView(
child: Card(
child: Column(
children: [
SingleItemDropDownMenu<Lookup, RetirementTypeProvider>(
context: context,
title: context.translation.retirementType,
backgroundColor: AppColor.fieldBgColor(context),
showAsBottomSheet: true,
height: 56.toScreenHeight,
showShadow: false,
initialValue: requestDetailProvider.assetRetiredHelperModel?.retirmentReason,
onSelect: (value) {
if (value != null) {
requestDetailProvider.assetRetiredHelperModel?.retirmentReason = value;
setState(() {});
}
},
),
8.height,
AppTextFormField(
labelText: context.translation.comments,
textInputType: TextInputType.multiline,
showWithoutDecoration: true,
labelStyle: AppTextStyles.textFieldLabelStyle,
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral100,
alignLabelWithHint: true,
onChange: (text) {
requestDetailProvider.assetRetiredHelperModel?.retirementComment = text;
},
onSaved: (text) {
requestDetailProvider.assetRetiredHelperModel?.retirementComment = text;
},
),
23.height,
AttachmentPicker(
label: context.translation.attachFiles,
attachment: attachments,
buttonIcon: 'image-plus'.toSvgAsset(),
),
],
).paddingOnly(start: 13, end: 13, top: 14, bottom: 16),
).paddingAll(16),
).expanded,
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(
label: context.translation.submit,
buttonColor: AppColor.primary10,
loading: requestDetailProvider.isLoading,
onPressed: () async {
requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments = [];
for (var attachment in attachments) {
String fileName = ServiceRequestUtils.isLocalUrl(attachment.name??'') ? ("${attachment.name??''.split("/").last}|${base64Encode(File(attachment.name??'').readAsBytesSync())}") :attachment.name??'';
requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments
?.add(ActivityAssetToBeRetiredAttachments(id: attachment.id, name: fileName));
}
int status = await requestDetailProvider.createActivityAssetToBeRetired();
if (status == 200) {
Navigator.pop(context);
requestDetailProvider.stopTimer();
const SizedBox().flushBar(context: context, title: '', message: context.translation.assetRetirementRequestSubmittedSuccessfully);
}
},
),
return LoadingManager(
isLoading: _isLoading,
isFailedLoading: false,
stateCode: 200,
onRefresh: () async {},
child: Form(
key: _formKey,
child: Column(
children: [
SingleChildScrollView(
child: Card(
child: Column(
children: [
SingleItemDropDownMenu<Lookup, RetirementTypeProvider>(
context: context,
title: context.translation.retirementType,
backgroundColor: AppColor.fieldBgColor(context),
showAsBottomSheet: true,
height: 56.toScreenHeight,
showShadow: false,
initialValue: requestDetailProvider.assetRetiredHelperModel?.retirmentReason,
onSelect: (value) {
if (value != null) {
requestDetailProvider.assetRetiredHelperModel?.retirmentReason = value;
setState(() {});
}
},
),
8.height,
AppTextFormField(
labelText: context.translation.comments,
textInputType: TextInputType.multiline,
showWithoutDecoration: true,
labelStyle: AppTextStyles.textFieldLabelStyle,
backgroundColor: context.isDark ? AppColor.neutral20 : AppColor.neutral100,
alignLabelWithHint: true,
onChange: (text) {
requestDetailProvider.assetRetiredHelperModel?.retirementComment = text;
},
onSaved: (text) {
requestDetailProvider.assetRetiredHelperModel?.retirementComment = text;
},
),
23.height,
AttachmentPicker(
label: context.translation.attachFiles,
attachment: attachments,
buttonIcon: 'image-plus'.toSvgAsset(),
),
],
).paddingOnly(start: 13, end: 13, top: 14, bottom: 16),
).paddingAll(16),
).expanded,
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(
label: context.translation.submit,
buttonColor: AppColor.primary10,
loading: requestDetailProvider.isLoading,
onPressed: () async {
requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments = [];
for (var attachment in attachments) {
String fileName = ServiceRequestUtils.isLocalUrl(attachment.name??'') ? ("${attachment.name??''.split("/").last}|${base64Encode(File(attachment.name??'').readAsBytesSync())}") :attachment.name??'';
requestDetailProvider.assetRetiredHelperModel?.activityAssetToBeRetiredAttachments
?.add(ActivityAssetToBeRetiredAttachments(id: attachment.id, name: fileName));
}
int status = await requestDetailProvider.createActivityAssetToBeRetired();
if (status == 200) {
Navigator.pop(context);
requestDetailProvider.stopTimer();
const SizedBox().flushBar(context: context, title: '', message: context.translation.assetRetirementRequestSubmittedSuccessfully);
}
},
),
],
),
),
],
),
),
);

@ -13,6 +13,7 @@ import 'package:test_sa/models/helper_data_models/workorder/work_order_helper_mo
import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/new_models/work_order_detail_model.dart';
import 'package:test_sa/modules/cm_module/service_request_detail_provider.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
@ -328,10 +329,9 @@ class _VerifyAssetDetailsState extends State<VerifyAssetDetails> with TickerProv
] else ...[
assetStatusWidget(context: context, workOrderData: updateAssetModel!).toShadowContainer(context).paddingAll(16),
],
Container(
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
color: AppColor.background(context),
child: AppFilledButton(
FooterActionButton.footerContainer(
context: context,
child:AppFilledButton(
label: context.translation.updateAssetDetails,
buttonColor: AppColor.primary10,
onPressed: () async {

@ -7,6 +7,7 @@ import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/helper_data_models/workorder/work_order_helper_models.dart';
import 'package:test_sa/models/new_models/work_order_detail_model.dart';
import 'package:test_sa/modules/cm_module/service_request_detail_provider.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/app_lazy_loading.dart';
@ -185,9 +186,8 @@ class _CostDetailFormScreenState extends State<CostDetailFormScreen> with Ticker
],
).toShadowContainer(context).paddingAll(16),
).expanded,
Container(
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
color: AppColor.background(context),
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(
label: "Update Cost Details",
buttonColor: AppColor.primary10,

@ -65,80 +65,78 @@ class _CreateTaskViewState extends State<CreateTaskView> with TickerProviderStat
return Scaffold(
key: _scaffoldKey,
appBar: DefaultAppBar(title: context.translation.createTaskRequest),
body: SafeArea(
child: Form(
key: _formKey,
child: Column(
children: [
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SingleItemDropDownMenu<TaskType, TaskTypeProvider>(
context: context,
height: 56.toScreenHeight,
title: context.translation.taskType,
showShadow: false,
backgroundColor: AppColor.neutral100,
showAsBottomSheet: true,
initialValue: selectedType,
onSelect: (type) {
if (type != null) {
selectedType = type;
_addTaskModel = AddTaskModel(id: 0);
commentController.clear();
_addTaskModel?.taskTypeId = selectedType?.id;
setState(() {});
}
},
),
8.height,
taskTypeWidget(selectedType?.relatedTo?.value),
8.height,
if (selectedType != null && selectedType!.isRecallAndAlert!) ...[
recallAndAlert(),
],
8.height,
AppTextFormField(
initialValue: _addTaskModel?.callComment,
controller: commentController,
labelText: context.translation.callComments,
backgroundColor: AppColor.neutral100,
showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle,
alignLabelWithHint: true,
textInputType: TextInputType.multiline,
onChange: (value) {
_addTaskModel?.callComment = value;
},
),
23.height,
AttachmentPicker(
label: context.translation.attachImage,
attachment: attachments,
buttonColor: AppColor.black10,
onlyImages: false,
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
//verify this if not required delete this ..
onChange: (attachments) {
attachments = attachments;
body: Form(
key: _formKey,
child: Column(
children: [
SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SingleItemDropDownMenu<TaskType, TaskTypeProvider>(
context: context,
height: 56.toScreenHeight,
title: context.translation.taskType,
showShadow: false,
backgroundColor: AppColor.neutral100,
showAsBottomSheet: true,
initialValue: selectedType,
onSelect: (type) {
if (type != null) {
selectedType = type;
_addTaskModel = AddTaskModel(id: 0);
commentController.clear();
_addTaskModel?.taskTypeId = selectedType?.id;
setState(() {});
},
),
}
},
),
8.height,
taskTypeWidget(selectedType?.relatedTo?.value),
8.height,
if (selectedType != null && selectedType!.isRecallAndAlert!) ...[
recallAndAlert(),
],
).toShadowContainer(context).paddingAll(16),
).expanded,
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(
buttonColor: AppColor.primary10,
label: context.translation.submitRequest,
onPressed: _submit,
// buttonColor: AppColor.primary10,
),
8.height,
AppTextFormField(
initialValue: _addTaskModel?.callComment,
controller: commentController,
labelText: context.translation.callComments,
backgroundColor: AppColor.neutral100,
showShadow: false,
labelStyle: AppTextStyles.textFieldLabelStyle,
alignLabelWithHint: true,
textInputType: TextInputType.multiline,
onChange: (value) {
_addTaskModel?.callComment = value;
},
),
23.height,
AttachmentPicker(
label: context.translation.attachImage,
attachment: attachments,
buttonColor: AppColor.black10,
onlyImages: false,
buttonIcon: 'image-plus'.toSvgAsset(color: AppColor.neutral120),
//verify this if not required delete this ..
onChange: (attachments) {
attachments = attachments;
setState(() {});
},
),
],
).toShadowContainer(context).paddingAll(16),
).expanded,
FooterActionButton.footerContainer(
context: context,
child: AppFilledButton(
buttonColor: AppColor.primary10,
label: context.translation.submitRequest,
onPressed: _submit,
// buttonColor: AppColor.primary10,
),
],
),
),
],
),
),
);

Loading…
Cancel
Save