|
|
|
|
@ -9,6 +9,8 @@ import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/models/device/asset_by_id_model.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/default_app_bar.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';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/app_loading.dart';
|
|
|
|
|
import 'package:test_sa/views/widgets/loaders/failed_loading.dart';
|
|
|
|
|
|
|
|
|
|
@ -76,7 +78,7 @@ class _AssetDetailPageState extends State<AssetDetailPage> {
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: AppColor.neutral30,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
|
),
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
@ -96,7 +98,7 @@ class _AssetDetailPageState extends State<AssetDetailPage> {
|
|
|
|
|
backgroundColor: AppColor.getRequestStatusColorByName(context, assetModel.commissioningStatus!.name!),
|
|
|
|
|
),
|
|
|
|
|
if (assetModel.commissioningStatus != null) 8.height,
|
|
|
|
|
(assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-").heading5(context).custom(color: AppColor.textStyleColor(context)),
|
|
|
|
|
InfoHeader16Widget(assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"),
|
|
|
|
|
8.height,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -104,11 +106,10 @@ class _AssetDetailPageState extends State<AssetDetailPage> {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"${context.translation.assetNo}: ${assetModel.multiAssets!.first.assetNumber}".bodyText(context),
|
|
|
|
|
"${context.translation.modelName}: ${assetModel.modelDefinition!.modelName}".bodyText(context),
|
|
|
|
|
"${context.translation.supplier}: ${assetModel.supplier?.suppliername ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.manufacture}: ${assetModel.modelDefinition!.manufacturerName}".bodyText(context),
|
|
|
|
|
//"${context.translation.location}: ${assetModel.site.custName?.cleanupWhitespace?.capitalizeFirstOfEach}".bodyText(context),
|
|
|
|
|
InfoTextWidget(label: context.translation.assetNo, value: assetModel.multiAssets!.first.assetNumber, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.modelName, value: assetModel.modelDefinition!.modelName, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.supplier, value: assetModel.supplier?.suppliername, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.manufacture, value: assetModel.modelDefinition!.manufacturerName, showEmptyValue: true),
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
8.width,
|
|
|
|
|
@ -117,12 +118,12 @@ class _AssetDetailPageState extends State<AssetDetailPage> {
|
|
|
|
|
children: [
|
|
|
|
|
/// TODO: theres no [ORACLE CODE] available to preview
|
|
|
|
|
// "${context.translation.oracleCode}: ${"-"}".bodyText(context),
|
|
|
|
|
"${context.translation.snNo}: ${assetModel.multiAssets!.first.assetSerialNo}".bodyText(context),
|
|
|
|
|
"${context.translation.site}: ${assetModel.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.building}: ${assetModel.building?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.floor}: ${assetModel.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.md}: ${assetModel.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.room}: ${assetModel.room?.name?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"}".bodyText(context),
|
|
|
|
|
InfoTextWidget(label: context.translation.snNo, value: assetModel.multiAssets!.first.assetSerialNo, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.site, value: assetModel.site?.custName?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.building, value: assetModel.building?.name?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.floor, value: assetModel.floor?.name?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.md, value: assetModel.department?.departmentName?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.room, value: assetModel.room?.name?.cleanupWhitespace.capitalizeFirstOfEach, showEmptyValue: true),
|
|
|
|
|
],
|
|
|
|
|
).expanded,
|
|
|
|
|
],
|
|
|
|
|
@ -130,14 +131,13 @@ class _AssetDetailPageState extends State<AssetDetailPage> {
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider(color: AppColor.neutral30, height: 1, thickness: 1),
|
|
|
|
|
8.height,
|
|
|
|
|
"${context.translation.installationDate}: ${assetModel.installationDate?.toAssetDetailsFormat ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.nextPmDate}: ${assetModel.nextPMDate?.toAssetDetailsFormat ?? "-"}".bodyText(context),
|
|
|
|
|
"${context.translation.lastPmDate}: ${assetModel.lastPMDate?.toAssetDetailsFormat ?? "-"}".bodyText(context),
|
|
|
|
|
InfoTextWidget(label: context.translation.installationDate, value: assetModel.installationDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.nextPmDate, value: assetModel.nextPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
|
InfoTextWidget(label: context.translation.lastPmDate, value: assetModel.lastPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
|
if ((assetModel.modelDefinition?.assetDescription ?? "").isNotEmpty) ...[
|
|
|
|
|
8.height,
|
|
|
|
|
const Divider(color: AppColor.neutral30, height: 1, thickness: 1),
|
|
|
|
|
8.height,
|
|
|
|
|
assetModel.modelDefinition!.assetDescription!.bodyText(context),
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
InfoTextWidget(label: assetModel.modelDefinition!.assetDescription!, showEmptyValue: true, isMsg: true),
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|