From d03c1853342f3d6396181a98e69134d9a22f0c78 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Tue, 15 Sep 2026 09:13:11 +0300 Subject: [PATCH] map improvements --- lib/modules/asset_tracking/map_tracking_page.dart | 11 ++++++++--- .../asset_tracking/models/asset_tracking_model.dart | 2 +- .../common_widgets/multiple_item_drop_down_menu.dart | 3 +++ .../multiple_selection_fullscreen_dialog.dart | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/modules/asset_tracking/map_tracking_page.dart b/lib/modules/asset_tracking/map_tracking_page.dart index 882b5212..f275e19a 100644 --- a/lib/modules/asset_tracking/map_tracking_page.dart +++ b/lib/modules/asset_tracking/map_tracking_page.dart @@ -6,6 +6,7 @@ import 'package:flutter_map_geojson2/flutter_map_geojson2.dart'; import 'package:latlong2/latlong.dart'; import 'package:provider/provider.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/helper/utils.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; @@ -202,20 +203,24 @@ class _MapTrackingPageState extends State { maxHeight: 120, child: MultipleItemDropDownMenu( context: context, - title: 'Select Assets To View ', + title: 'Assets on The Floor', + hintMsg: 'Search By Label or Serial Number', initialValue: [], showShadow: false, staticData: assetsOnTheFloorList, showCancel: true, showAsFullScreenDialog: true, onSelect: (selectedAssets) { - print("selectedAssets:${selectedAssets?.length}"); setState(() { markers = [ for (var asset in selectedAssets!) Marker( point: LatLng(asset.location!.latitude!, asset.location!.longitude!), - child: const Icon(Icons.location_pin, color: AppColor.red30), + child: Tooltip( + triggerMode: TooltipTriggerMode.tap, + message: "Last seen: ${asset.location?.lastSeen?.toServiceRequestDetailsFormat}", + child: const Icon(Icons.location_pin, color: AppColor.red30), + ), ), ]; }); diff --git a/lib/modules/asset_tracking/models/asset_tracking_model.dart b/lib/modules/asset_tracking/models/asset_tracking_model.dart index 289588f1..b97b0130 100644 --- a/lib/modules/asset_tracking/models/asset_tracking_model.dart +++ b/lib/modules/asset_tracking/models/asset_tracking_model.dart @@ -19,8 +19,8 @@ class AssetTrackingModel extends Base { id = json['id']; identifier = json['id']?.toString(); label = json['label']; - name = json['label']; serialNumber = json['serialNumber']; + name = "$label ($serialNumber)"; group = json['group']; type = json['type'] != null ? new Type.fromJson(json['type']) : null; department = json['department'] != null ? new Type.fromJson(json['department']) : null; diff --git a/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart b/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart index 95d26ceb..7131e17c 100644 --- a/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart +++ b/lib/new_views/common_widgets/multiple_item_drop_down_menu.dart @@ -27,6 +27,7 @@ class MultipleItemDropDownMenu ex final bool showAsFullScreenDialog; final List? staticData; final String title; + final String? hintMsg; final double? height; final bool showShadow; final bool showCancel; @@ -39,6 +40,7 @@ class MultipleItemDropDownMenu ex const MultipleItemDropDownMenu({ Key? key, this.title = "", + this.hintMsg, required this.context, this.onSelect, this.initialValue = const [], @@ -302,6 +304,7 @@ class _MultipleItemDropDownMenuState extends StatefulWidget { final List selectedItem; // Now nullable final T? disableItem; // Now nullable final String title; + final String? hintMsg; final bool showCancel; final SelectionBuilderString builderString; final Function(List) onSelect; const MultipleSelectionFullScreenDialog( - {Key? key, this.items, this.selectedItem = const [], this.disableItem, this.title = "", required this.builderString, this.showCancel = false, required this.onSelect}) + {Key? key, this.items, this.selectedItem = const [], this.disableItem, this.title = "", this.hintMsg, required this.builderString, this.showCancel = false, required this.onSelect}) : super(key: key); @override @@ -108,7 +109,7 @@ class _SelectionBottomSheetState extends State( TextStyle(color: AppColor.textColor(context), fontSize: 14.0), ), - hintText: 'Search by name', + hintText: widget.hintMsg ?? 'Search by name', onChanged: (queryString) { query = queryString; setState(() {});