map tracking added
parent
4b932099f5
commit
addbe3f729
@ -0,0 +1,45 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import 'package:test_sa/models/base.dart';
|
||||
|
||||
class PenguinSiteModel extends Base {
|
||||
int? id;
|
||||
String? label;
|
||||
bool? isMapped;
|
||||
|
||||
PenguinSiteModel({this.id, this.label}) : super(identifier: id?.toString(), name: label);
|
||||
|
||||
PenguinSiteModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
identifier = json['id']?.toString();
|
||||
label = json['label'];
|
||||
name = json['label'];
|
||||
isMapped = json['isMapped'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['label'] = this.label;
|
||||
data['isMapped'] = this.isMapped;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue