From f1f145a35fe7599ceccb3d80d05e344b382ae7da Mon Sep 17 00:00:00 2001 From: stopflock Date: Fri, 24 Oct 2025 17:11:43 -0500 Subject: [PATCH] Operator profiles as list. Add simon property group. --- README.md | 25 ++++--------- lib/models/operator_profile.dart | 54 ++++++++++++++++++--------- lib/state/operator_profile_state.dart | 7 +--- 3 files changed, 44 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index d220ad5..a7a1412 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,9 @@ cp lib/keys.dart.example lib/keys.dart ### Current Development - Import/Export map providers - Swap in alprwatch.org/directions avoidance routing API -- Help button with links to email, discord, and website - Clean cache when nodes have disappeared / been deleted by others / queue item was deleted - Improve offline area node refresh live display -- Add default operator profiles (Lowe’s etc) -- Add Rekor, generic PTZ profiles +- Add Rekor profile ### Future Features & Wishlist - Update offline area nodes while browsing? @@ -104,21 +102,12 @@ cp lib/keys.dart.example lib/keys.dart - Suspected locations expansion to more regions ### Maybes -- Yellow ring for devices missing specific tag details? -- "Cache accumulating" offline area? -- "Offline areas" as tile provider? -- Maybe we could grab the full latest database for each profile just like for suspected locations? (Instead of overpass) -- Optional custom icons for camera profiles? -- Upgrade device marker design? (considering nullplate's svg) -- Custom device providers and OSM/Overpass alternatives? -- More map data providers: -https://gis.sanramon.ca.gov/arcgis_js_api/sdk/jsapi/esri.basemaps-amd.html#osm -https://www.icgc.cat/en/Geoinformation-and-Maps/Base-Map-Service -https://github.com/CartoDB/basemap-styles -https://forum.inductiveautomation.com/t/perspective-map-theming-internet-tile-server-options/40164 -https://github.com/roblabs/xyz-raster-sources -https://github.com/geopandas/xyzservices/blob/main/provider_sources/xyzservices-providers.json -https://medium.com/@go2garret/free-basemap-tiles-for-maplibre-18374fab60cb +- Yellow ring for devices missing specific tag details +- "Cache accumulating" offline area +- "Offline areas" as tile provider +- Grab the full latest database for each profile just like for suspected locations (instead of overpass) +- Optional custom icons for profiles to aid identification +- Custom device providers and OSM/Overpass alternatives --- diff --git a/lib/models/operator_profile.dart b/lib/models/operator_profile.dart index 3cbe87a..0ed463f 100644 --- a/lib/models/operator_profile.dart +++ b/lib/models/operator_profile.dart @@ -13,27 +13,45 @@ class OperatorProfile { required this.tags, }); + /// Get all built-in default operator profiles + static List getDefaults() => [ + OperatorProfile( + id: 'builtin-lowes', + name: "Lowe's", + tags: const { + 'operator': "Lowe's", + 'operator:wikidata': 'Q1373493', + 'operator:type': 'private', + }, + ), + OperatorProfile( + id: 'builtin-home-depot', + name: 'The Home Depot', + tags: const { + 'operator': 'The Home Depot', + 'operator:wikidata': 'Q864407', + 'operator:type': 'private', + }, + ), + OperatorProfile( + id: 'builtin-simon-property-group', + name: 'Simon Property Group', + tags: const { + 'operator': 'Simon Property Group', + 'operator:wikidata': 'Q2287759', + 'operator:type': 'private', + }, + ), + ]; + /// Built-in default: Lowe's operator profile - factory OperatorProfile.lowes() => OperatorProfile( - id: 'builtin-lowes', - name: "Lowe's", - tags: const { - 'operator': "Lowe's", - 'operator:wikidata': 'Q1373493', - 'operator:type': 'private', - }, - ); + factory OperatorProfile.lowes() => getDefaults()[0]; /// Built-in default: The Home Depot operator profile - factory OperatorProfile.homeDepot() => OperatorProfile( - id: 'builtin-home-depot', - name: 'The Home Depot', - tags: const { - 'operator': 'The Home Depot', - 'operator:wikidata': 'Q864407', - 'operator:type': 'private', - }, - ); + factory OperatorProfile.homeDepot() => getDefaults()[1]; + + /// Built-in default: Simon Property Group operator profile + factory OperatorProfile.simonPropertyGroup() => getDefaults()[2]; OperatorProfile copyWith({ String? id, diff --git a/lib/state/operator_profile_state.dart b/lib/state/operator_profile_state.dart index addbf12..9ff87a2 100644 --- a/lib/state/operator_profile_state.dart +++ b/lib/state/operator_profile_state.dart @@ -13,12 +13,7 @@ class OperatorProfileState extends ChangeNotifier { // Add default operator profiles if this is first launch if (addDefaults) { - final defaults = [ - OperatorProfile.lowes(), - OperatorProfile.homeDepot(), - ]; - - _profiles.addAll(defaults); + _profiles.addAll(OperatorProfile.getDefaults()); await OperatorProfileService().save(_profiles); } }