|
|
|
@ -18,11 +18,13 @@ import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
class AssetDetailsView extends StatefulWidget {
|
|
|
|
class AssetDetailsView extends StatefulWidget {
|
|
|
|
final AssetByIdModel assetModel;
|
|
|
|
final AssetByIdModel assetModel;
|
|
|
|
final VoidCallback onUpload;
|
|
|
|
final VoidCallback onUpload;
|
|
|
|
|
|
|
|
final VoidCallback linkAssetTag;
|
|
|
|
|
|
|
|
|
|
|
|
const AssetDetailsView({
|
|
|
|
const AssetDetailsView({
|
|
|
|
Key? key,
|
|
|
|
Key? key,
|
|
|
|
required this.assetModel,
|
|
|
|
required this.assetModel,
|
|
|
|
required this.onUpload,
|
|
|
|
required this.onUpload,
|
|
|
|
|
|
|
|
required this.linkAssetTag,
|
|
|
|
}) : super(key: key);
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -292,6 +294,35 @@ class _AssetDetailsViewState extends State<AssetDetailsView> with SingleTickerPr
|
|
|
|
InfoTextWidget(label: context.translation.installationDate, value: widget.assetModel.installationDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
InfoTextWidget(label: context.translation.installationDate, value: widget.assetModel.installationDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
InfoTextWidget(label: context.translation.nextPmDate, value: widget.assetModel.nextPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
InfoTextWidget(label: context.translation.nextPmDate, value: widget.assetModel.nextPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
InfoTextWidget(label: context.translation.lastPmDate, value: widget.assetModel.lastPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
InfoTextWidget(label: context.translation.lastPmDate, value: widget.assetModel.lastPMDate?.toAssetDetailsFormat, showEmptyValue: true),
|
|
|
|
|
|
|
|
if (widget.assetModel.penguinAssetTagId == null && context.userProvider.isEngineer) ...[
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
const InfoTextLabelWidget(label: '*Asset not linked with tracking tag', color: AppColor.red30).flexible,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: const EdgeInsets.only(left: 12, right: 12),
|
|
|
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: AppColor.primary10,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(35),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
"Link Tag",
|
|
|
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.addItemButtonColor(context)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
).onPress(widget.linkAssetTag),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
] else ...[
|
|
|
|
|
|
|
|
const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
InfoHeaderWidget("Tag Information"),
|
|
|
|
|
|
|
|
InfoTextWidget(label: "Label", value: widget.assetModel.tagDetails?.label, showEmptyValue: true),
|
|
|
|
|
|
|
|
InfoTextWidget(label: "Tag ID", value: widget.assetModel.tagDetails?.tagId, showEmptyValue: true),
|
|
|
|
|
|
|
|
InfoTextWidget(label: "MAC Address", value: widget.assetModel.tagDetails?.macAddress, showEmptyValue: true),
|
|
|
|
|
|
|
|
// InfoTextWidget(label: "Type", value: assetModel?.tagDetails?.type, showEmptyValue: true),
|
|
|
|
|
|
|
|
// InfoTextWidget(label: "Status", value: assetModel?.tagDetails?.status, showEmptyValue: true),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|