|
|
|
@ -6,6 +6,8 @@ import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
import 'package:test_sa/models/device/asset.dart';
|
|
|
|
import 'package:test_sa/models/device/asset.dart';
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
|
|
|
|
|
|
|
|
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class AssetDetailBottomSheet extends StatelessWidget {
|
|
|
|
class AssetDetailBottomSheet extends StatelessWidget {
|
|
|
|
Asset? asset;
|
|
|
|
Asset? asset;
|
|
|
|
@ -16,14 +18,14 @@ class AssetDetailBottomSheet extends StatelessWidget {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: MediaQuery.of(context).viewInsets.bottom +
|
|
|
|
bottom: MediaQuery.of(context).viewInsets.bottom + MediaQuery.of(context).padding.bottom,
|
|
|
|
MediaQuery.of(context).padding.bottom,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
(asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)),
|
|
|
|
// (asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)),
|
|
|
|
|
|
|
|
InfoHeader16Widget(asset?.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"),
|
|
|
|
16.height,
|
|
|
|
16.height,
|
|
|
|
AspectRatio(
|
|
|
|
AspectRatio(
|
|
|
|
aspectRatio: 358 / 136,
|
|
|
|
aspectRatio: 358 / 136,
|
|
|
|
@ -52,33 +54,70 @@ class AssetDetailBottomSheet extends StatelessWidget {
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
"${context.translation.assetNo}: ${asset!.assetNumber}".bodyText(context),
|
|
|
|
InfoTextWidget(
|
|
|
|
"${context.translation.modelName}: ${asset!.modelDefinition?.modelName}".bodyText(context),
|
|
|
|
label: context.translation.assetNo,
|
|
|
|
"${context.translation.supplier}: ${asset!.supplier?.suppliername?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
value: asset!.assetNumber,
|
|
|
|
"${context.translation.manufacture}: ${asset!.modelDefinition?.manufacturerName?.cleanupWhitespace.capitalizeFirstOfEach}".bodyText(context),
|
|
|
|
showEmptyValue: true,
|
|
|
|
//"${context.translation.location}: ${assetModel.site.custName?.cleanupWhitespace?.capitalizeFirstOfEach}".bodyText(context),
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.modelName,
|
|
|
|
|
|
|
|
value: asset!.modelDefinition?.modelName,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.supplier,
|
|
|
|
|
|
|
|
value: asset!.supplier?.suppliername?.cleanupWhitespace.capitalizeFirstOfEach,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.manufacture,
|
|
|
|
|
|
|
|
value: asset!.modelDefinition?.manufacturerName?.cleanupWhitespace.capitalizeFirstOfEach,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
8.width,
|
|
|
|
8.width,
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
"${context.translation.snNo}: ${asset!.assetSerialNo}".bodyText(context),
|
|
|
|
InfoTextWidget(
|
|
|
|
"${context.translation.site}: ${asset?.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
label: context.translation.snNo,
|
|
|
|
"${context.translation.building}: ${asset?.building?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
value: asset!.assetSerialNo,
|
|
|
|
"${context.translation.floor}: ${asset?.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
showEmptyValue: true,
|
|
|
|
"${context.translation.md}: ${asset?.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
),
|
|
|
|
"${context.translation.room}: ${asset?.room?.name ?? "-"}".bodyText(context),
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.site,
|
|
|
|
|
|
|
|
value: asset?.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.building,
|
|
|
|
|
|
|
|
value: asset?.building?.name?.cleanupWhitespace.capitalizeFirstOfEach,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.floor,
|
|
|
|
|
|
|
|
value: asset?.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.md,
|
|
|
|
|
|
|
|
value: asset?.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
InfoTextWidget(
|
|
|
|
|
|
|
|
label: context.translation.room,
|
|
|
|
|
|
|
|
value: asset?.room?.name,
|
|
|
|
|
|
|
|
showEmptyValue: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
8.height,
|
|
|
|
8.height,
|
|
|
|
if ((asset?.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[
|
|
|
|
if ((asset?.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[
|
|
|
|
8.height,
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
const Divider(color: AppColor.neutral30, height: 1, thickness: 1),
|
|
|
|
InfoTextWidget(label: asset!.modelDefinition!.assetDescription!, isMsg: true, showEmptyValue: true),
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
asset!.modelDefinition!.assetDescription!.bodyText(context),
|
|
|
|
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|