-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[google_maps_flutter]ChangeNotifier is replaced with granular callbacks #1302
Changes from 1 commit
6566963
cd47239
b55f004
e3c5cbf
f6fbbda
e488e75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,11 @@ part of google_maps_flutter; | |
|
|
||
| typedef void MapCreatedCallback(GoogleMapController controller); | ||
|
|
||
| /// Callback that tracks camera position. | ||
|
||
| /// | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably worth adding "Used by: " and listing the relevant GoogleMap fields. |
||
| /// Will be null if trackCameraPosition on [GoogleMap] is false. | ||
|
||
| typedef void CameraPositionCallback(CameraPosition position); | ||
|
|
||
| class GoogleMap extends StatefulWidget { | ||
| const GoogleMap({ | ||
| @required this.initialCameraPosition, | ||
|
|
@@ -22,6 +27,11 @@ class GoogleMap extends StatefulWidget { | |
| this.trackCameraPosition = false, | ||
| this.myLocationEnabled = false, | ||
| this.markers, | ||
| this.onCameraMoveStarted, | ||
| this.onCameraMove, | ||
| this.onCameraIdle, | ||
| this.onMapOptionsUpdate, | ||
| this.onMarkersUpdate, | ||
| }) : assert(initialCameraPosition != null); | ||
|
|
||
| final MapCreatedCallback onMapCreated; | ||
|
|
@@ -58,9 +68,24 @@ class GoogleMap extends StatefulWidget { | |
| /// True if the map view should relay camera move events to Flutter. | ||
| final bool trackCameraPosition; | ||
|
|
||
| // Markers to be placed on the map. | ||
| /// Markers to be placed on the map. | ||
| final Set<Marker> markers; | ||
|
|
||
| /// Callback for when the camera move started. | ||
|
||
| final VoidCallback onCameraMoveStarted; | ||
|
|
||
| /// Callback for when the camera is moving. | ||
|
||
| final CameraPositionCallback onCameraMove; | ||
|
|
||
| /// Callback for when the camera has entered an idle stage. | ||
| final VoidCallback onCameraIdle; | ||
|
|
||
| /// Callback when the [GoogleMap] options have been applied on the platform. | ||
| final CameraPositionCallback onMapOptionsUpdate; | ||
|
||
|
|
||
| /// Callback for when the [Marker] options have been applied on the platform. | ||
| final VoidCallback onMarkersUpdate; | ||
|
|
||
| /// True if a "My Location" layer should be shown on the map. | ||
| /// | ||
| /// This layer includes a location indicator at the current device location, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's nice to see!