manara_map library
Manara Map — OpenStreetMap-based map widgets backed by the Manara Maps service.
Two widgets make up the public surface:
ManaraMapWidget— an interactive map with address search, reverse geocoding as the user pans, device location, a directions picker, and live rider tracking.ManaraRouteMapWidget— a watch-only map that follows a trip already in progress between a fixed pickup and drop-off.
Both take an API key and the base URL of your Manara Maps environment, and both can have their search fields, buttons, and markers replaced without forking the package. See the README for setup and platform permissions.
Classes
- AnimatedRiderMarker
- Wraps a rider marker so it glides smoothly to each newly-received point instead of snapping to it.
- DefaultDirectionsButton
- The button drawn beside the search field when no DirectionsButtonBuilder is supplied: a small icon button that changes color while the picker is open.
- DefaultRiderMarker
- The marker drawn at the rider's live position while tracking, when no RiderMarkerBuilder is supplied: a rider icon rotated to face heading, pulsing gently so it reads as live.
- DefaultRouteMarker
- The marker drawn at a route endpoint when no RouteMarkerBuilder is supplied: a house icon on a teardrop badge in the package's accent color for RouteMarkerType.start, and a destination pin image for RouteMarkerType.end.
- DirectionsFieldContext
- The directions-picker state and callbacks handed to a DirectionsFieldBuilder.
- LocationEntity
- A point on the map, in WGS 84 decimal degrees.
- ManaraMapController
- Drives a map widget programmatically — pan and zoom it from your own code, outside anything the user does on screen.
- ManaraMapWidget
- An interactive map for picking a location: it opens on the device's position, reverse-geocodes whatever the user pans to, and offers address search, a directions picker, and live rider tracking on top.
- ManaraRouteMapWidget
- A watch-only map for following a trip already under way: it marks the pickup and the destination, draws the route between them, and shows the rider's live position as an arrow facing their direction of travel.
- MapMarkerIcon
-
The stationary pin centered over the map in
ManaraMapWidget, marking the point whose address is being resolved as the user pans. - MapSearchFieldContext
- The search state and callbacks handed to a MapSearchFieldBuilder.
- MarkerAnimation
- Adds a slow, repeating pulse behind child — an expanding, fading circle in the package's accent color — so a rider marker reads as live rather than as a static pin.
- RouteEntity
- A route between two points, as the ordered list of coordinates that draws its line on the map.
- SearchResultEntity
- One address returned by an address search — a label to show the user and the point to move the map to when they pick it.
Enums
- RouteMarkerType
- Which end of a route a marker represents.
Extensions
- LocationEntityPatterns on LocationEntity
- Adds pattern-matching-related methods to LocationEntity.
- RouteEntityPatterns on RouteEntity
- Adds pattern-matching-related methods to RouteEntity.
- SearchResultEntityPatterns on SearchResultEntity
- Adds pattern-matching-related methods to SearchResultEntity.
Typedefs
- DirectionsButtonBuilder = Widget Function(BuildContext context, VoidCallback onPressed, bool isActive)
- Builds a replacement for the button that opens the map's directions picker.
- DirectionsFieldBuilder = Widget Function(BuildContext context, DirectionsFieldContext directions)
- Builds a replacement for the built-in source/destination field pair shown by the map's directions picker.
- MapSearchFieldBuilder = Widget Function(BuildContext context, MapSearchFieldContext search)
- Builds a replacement for the map's built-in address search field.
- OnAddressChanged = void Function(double latitude, double longitude, String address)
- Callback when user selects a location with address (latitude, longitude, address).
- OnDirectionsRouteError = void Function(String message)
- Called when a directions request fails.
- OnDirectionsRouteFound = void Function(RouteEntity route)
- Called once a route between the picked source and destination is found.
- OnLocationChanged = void Function(double latitude, double longitude)
- Callback when user selects a location (latitude, longitude).
- OnRouteError = void Function(String message)
- Called when a directions request fails.
- OnRouteFound = void Function(RouteEntity route)
- Called once a route between the start and end points has been found.
- OnSearchActiveChanged = void Function(bool isSearchActive)
- Callback when search active state changes.
- RiderMarkerBuilder = Widget Function(BuildContext context, double heading)
- Builds a custom marker for the rider's live position while tracking is running, replacing the start marker for as long as it runs.
- RouteMarkerBuilder = Widget Function(BuildContext context, RouteMarkerType type)
- Builds a custom marker for a route's start or end point.
Exceptions / Errors
- ApiException
- Thrown when the Manara Maps API answers a request with an error status.
- LocationException
- Thrown when the device's location services are switched off, so no position can be read even though the app holds permission.
- NetworkException
- Thrown when a request could not reach the Manara Maps API at all — the device is offline, the host is unreachable, or the connection timed out.
- PermissionException
- Thrown when the user denied the app's location permission.