improvement

main_production_asset_tracking
Sikander Saleem 2 weeks ago
parent 16d80afb20
commit d6ed4412ae

@ -13,8 +13,9 @@ import 'models/asset_tracking_model.dart';
class AssetTrackingListItemView extends StatelessWidget {
final AssetTrackingModel asset;
bool isGridView;
bool showViewOnMap;
AssetTrackingListItemView(this.asset, this.isGridView, {Key? key}) : super(key: key);
AssetTrackingListItemView(this.asset, this.isGridView, {Key? key, this.showViewOnMap = true}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -38,10 +39,10 @@ class AssetTrackingListItemView extends StatelessWidget {
label: "Last seen",
value: asset.location?.lastSeen?.toServiceRequestDetailsFormat,
showEmptyValue: true,
showArrow: isGridView ? false : true,
arrowMsg: isGridView ? "" : "View on map",
showArrow: showViewOnMap ? (isGridView ? false : true) : false,
arrowMsg: showViewOnMap ? (isGridView ? "" : "View on map") : "",
),
if (isGridView) ...[
if (showViewOnMap && isGridView) ...[
5.height,
InfoTextWidget(
label: "View on map",

@ -348,7 +348,7 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
shrinkWrap: true,
itemCount: zone.assets.length,
separatorBuilder: (_, __) => 12.height,
itemBuilder: (_, index) => AssetTrackingListItemView(zone.assets[index], false),
itemBuilder: (_, index) => AssetTrackingListItemView(zone.assets[index], false, showViewOnMap: false),
),
),
],
@ -384,13 +384,12 @@ class _MapTrackingPageState extends State<MapTrackingPage> {
Selector<AssetTrackingProvider, List<AssetTrackingModel>>(
selector: (_, provider) => inAppView ? List<AssetTrackingModel>.of(provider.assetsOnTheFloorList) : const [],
builder: (_, floorAssets, __) {
final zoneBadges = _buildZoneBadgeMarkers(floorAssets);
// Hide zone count badges while asset pins are shown, to avoid overlapping/confusing UI.
final zoneBadges = markers.isEmpty ? _buildZoneBadgeMarkers(floorAssets) : const <Marker>[];
return Stack(
children: [
GestureDetector(
onTap: _onFeatureTapped,
// A new MemoryGeoJson is created on every build, so GeoJsonLayer re-parses
// the features and `onPolygon` is called again with the latest assets.
child: GeoJsonLayer.memory(
_geojson!,
hitNotifier: _polygonHitNotifier,

Loading…
Cancel
Save