|
|
|
|
@ -84,58 +84,22 @@ class _TechnicalInspectionLinesListViewState extends State<TechnicalInspectionLi
|
|
|
|
|
),
|
|
|
|
|
body: Form(
|
|
|
|
|
key: _formKey,
|
|
|
|
|
child: Column(
|
|
|
|
|
child: (isLoading)
|
|
|
|
|
? const CircularProgressIndicator(color: AppColor.primary10).center
|
|
|
|
|
: (technicalInspectionLinesList.isEmpty)
|
|
|
|
|
? const NoDataFound().center
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: linesList(context).toShadowContainer(context, borderRadius: 20, padding: 12),
|
|
|
|
|
),
|
|
|
|
|
if (!viewOnly) ...[
|
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
|
context: context,
|
|
|
|
|
child: AppFilledButton(buttonColor: AppColor.primary10, label: 'Attachments'.addTranslation, maxWidth: true, onPressed: _attachmentTap),
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
],
|
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
|
context: context,
|
|
|
|
|
child: !viewOnly
|
|
|
|
|
? Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
label: 'Cancel'.addTranslation,
|
|
|
|
|
maxWidth: true,
|
|
|
|
|
buttonColor: AppColor.background(context),
|
|
|
|
|
// textColor: context.isDark ? AppColor.neutral30 : Colors.white,
|
|
|
|
|
textColor: AppColor.red30,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
onPressed: _cancelTap,
|
|
|
|
|
).expanded,
|
|
|
|
|
12.width,
|
|
|
|
|
AppFilledButton(buttonColor: AppColor.green70, label: 'Change Status'.addTranslation, maxWidth: true, onPressed: _changeStatusTap).expanded,
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: AppFilledButton(buttonColor: AppColor.primary10, label: 'Next'.addTranslation, maxWidth: true, onPressed: _nextTap),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget linesList(BuildContext context) {
|
|
|
|
|
if (isLoading) {
|
|
|
|
|
return SizedBox.expand(
|
|
|
|
|
child: const CircularProgressIndicator(color: AppColor.primary10).center,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (technicalInspectionLinesList.isEmpty) {
|
|
|
|
|
return const NoDataFound().center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
itemCount: technicalInspectionLinesList.length + 1, // +1 for the header
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
ListView.separated(
|
|
|
|
|
padding: const EdgeInsets.all(0),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount: technicalInspectionLinesList.length + 1,
|
|
|
|
|
// +1 for the header
|
|
|
|
|
separatorBuilder: (_, __) => 8.height,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
@ -164,7 +128,40 @@ class _TechnicalInspectionLinesListViewState extends State<TechnicalInspectionLi
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
).toShadowContainer(context, borderRadius: 20, padding: 12);
|
|
|
|
|
).toShadowContainer(context, borderRadius: 20, padding: 12),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).expanded,
|
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
|
context: context,
|
|
|
|
|
child: !viewOnly
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
AppFilledButton(buttonColor: AppColor.primary10, label: 'Attachments'.addTranslation, maxWidth: true, onPressed: _attachmentTap),
|
|
|
|
|
16.height,
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppFilledButton(
|
|
|
|
|
label: 'Cancel'.addTranslation,
|
|
|
|
|
maxWidth: true,
|
|
|
|
|
buttonColor: AppColor.background(context),
|
|
|
|
|
// textColor: context.isDark ? AppColor.neutral30 : Colors.white,
|
|
|
|
|
textColor: AppColor.red30,
|
|
|
|
|
showBorder: true,
|
|
|
|
|
onPressed: _cancelTap,
|
|
|
|
|
).expanded,
|
|
|
|
|
12.width,
|
|
|
|
|
AppFilledButton(buttonColor: AppColor.green70, label: 'Change Status'.addTranslation, maxWidth: true, onPressed: _changeStatusTap).expanded,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: AppFilledButton(buttonColor: AppColor.primary10, label: 'Next'.addTranslation, maxWidth: true, onPressed: _nextTap),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//May be need to show data.
|
|
|
|
|
|