You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.9 KiB
Dart
46 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
import 'package:test_sa/extensions/widget_extensions.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';
|
|
import 'package:test_sa/views/widgets/requests/request_status.dart';
|
|
|
|
import 'models/asset_tracking_model.dart';
|
|
|
|
class AssetTrackingListItemView extends StatelessWidget {
|
|
final AssetTrackingModel asset;
|
|
|
|
AssetTrackingListItemView(this.asset, {Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
StatusLabel(
|
|
label: (asset.location?.isLive ?? false) ? "Live" : "Not Live",
|
|
radius: 4,
|
|
textColor: AppColor.getPriorityStatusTextColor(context, (asset.location?.isLive ?? false) ? 0 : 1),
|
|
backgroundColor: AppColor.getPriorityStatusColor(context, (asset.location?.isLive ?? false) ? 0 : 1),
|
|
),
|
|
4.height,
|
|
InfoHeader16Widget(asset.label ?? ""),
|
|
InfoTextWidget(label: "Serial No", value: asset.label, showEmptyValue: true),
|
|
InfoTextWidget(label: "Type", value: asset.type?.name, showEmptyValue: true),
|
|
InfoTextWidget(label: "Status", value: asset.status?.name, showEmptyValue: true),
|
|
InfoTextWidget(label: "Department", value: asset.department?.name, showEmptyValue: true),
|
|
InfoTextWidget(
|
|
label: "Last seen",
|
|
value: asset.location?.lastSeen?.toServiceRequestDetailsFormat,
|
|
showEmptyValue: true,
|
|
showArrow: true,
|
|
arrowMsg: "View on map",
|
|
),
|
|
],
|
|
).toShadowContainer(context);
|
|
}
|
|
}
|