plug_location_map library

plug_location_map

Body-only package. Host app always provides its own AppBar.

Scaffold(
  appBar: AppBar(title: Text('Location')),   // ← host manages AppBar
  body: PlugLocationMap(                      // ← package body only
    mode: PlugMapMode.addressPicker,
    onAddressSaved: (address) {
      print(address.name);       // contact name
      print(address.street);     // street address
      print(address.city);       // city
      print(address.pincode);    // zip / PIN code
      print(address.lat);        // latitude
      print(address.lng);        // longitude
      print(address.fullAddress);// formatted full address
    },
  ),
)

Classes

AddEditAddressScreen
Instacart-style address form.
AddressFormState
AddressPickerScreen
ChooseAddressScreen
Instacart "Choose address" list. NO Scaffold. NO AppBar. Host provides both.
CurrentLocationFab
FirebaseAddress
Firestore document model.
FirebaseAddressService
Firestore CRUD for users/{userId}/addresses. Every write automatically enqueues through riverpod_offline_sync so operations survive connectivity gaps.
FlowNotifier
FormNotifier
LiveTrackingScreen
Real-time tracking screen. NO Scaffold. Body only.
LocationBar
Optional. Place in the host's own AppBar:
NoLocationScreen
Shown when: • User exits SelectLocationScreen without confirming a location • First open and location flow = LocationFlowStatus.noLocationSet
PlacePrediction
PlugAddress
The address model exposed to the host app.
PlugChooseAddressButton
A ready-made button for your home page. On tap, opens Choose Address.
PlugColors
PlugError
PlugErrorScreen
PlugFlow
Static entry points for opening package flows from anywhere — no routes, no Navigator boilerplate. The package handles the rest internally.
PlugHomeWrapper
Drop this in your home page's body. You build the AppBar; the wrapper decides what to show:
PlugLocation
A resolved GPS / map-picked location before it becomes a full PlugAddress.
PlugLocationApp
Root wrapper. Put it once, above your app, and the package handles everything: Riverpod setup (auto-guarded), permissions, Hive, offline sync, Firebase wiring, and theming.
PlugLocationGate
App-open gate. Drop inside the Scaffold body:
PlugLocationMap
Body-only widget. Host app provides AppBar.
PlugMapConfig
PlugMapScope
Wrap your app once at the root:
PlugMapTheme
PlugScreenUtilGuard
Transparent passthrough when the host already called ScreenUtilInit. Self-initialises at 375×812 otherwise.
PlugStorageAdapter
PlugText
SavedAddressesNotifier
SearchNotifier
SelectLocationScreen
Zomato-style full-screen draggable-pin map picker.
SharedPrefsAdapter
SmartGoogleMapLocation
Simplest single-widget usage:
SmartLocationWrapper
Blocks any page until location is resolved:

Properties

plugConfigProvider → Provider<PlugMapConfig>
final
plugFirebaseProvider → ProviderFamily<FirebaseAddressService?, String?>
final
plugFlowProvider → AsyncNotifierProvider<FlowNotifier, LocationFlowStatus>
App-open location resolution flow.
final
plugFormProvider → NotifierProvider<FormNotifier, AddressFormState>
Address form state (all fields + PIN auto-fill).
final
plugGpsProvider → Provider<GpsService>
final
plugLiveLocationProvider → StreamProvider<Position>
Live GPS position stream.
final
plugPlacesProvider → Provider<PlacesSearchService>
final
plugSavedAddressesProvider → AsyncNotifierProvider<SavedAddressesNotifier, List<PlugAddress>>
List of all saved addresses.
final
plugSearchProvider → AsyncNotifierProvider<SearchNotifier, List<PlacePrediction>>
Places autocomplete results — 350 ms debounce.
final
plugSelectedAddressProvider → StateProvider<PlugAddress?>
The currently selected address (or null when nothing selected).
final
plugSelectedLocationProvider → StateProvider<PlugLocation?>
The raw GPS / map-picked location (set before address form is filled).
final
plugStorageProvider → Provider<AddressStorage>
final