This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[google_maps_flutter]ChangeNotifier is replaced with granular callbacks #1302
Merged
iskakaushik
merged 6 commits into
flutter:master
from
iskakaushik:remove-change-notifier
Mar 5, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6566963
ChangeNotifier is replaced with granular callbacks
cd47239
Make docs better
b55f004
Remove camera update call backs for map and marker update
e3c5cbf
Fix up some links and caps.
f6fbbda
Update changelog and pubspec.
e488e75
fix unused var
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,15 @@ part of google_maps_flutter; | |
|
|
||
| typedef void MapCreatedCallback(GoogleMapController controller); | ||
|
|
||
| /// Callback that receives updates to the 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. |
||
| /// This callback is triggered when the platform Google Map | ||
| /// registers a camera movement. This will be called with null if | ||
| /// [GoogleMap.trackCameraPosition] is false. | ||
| /// | ||
| /// This is used in [GoogleMap.onCameraMove] and [GoogleMap.onMapOptionsUpdate]. | ||
| typedef void CameraPositionCallback(CameraPosition position); | ||
|
|
||
| class GoogleMap extends StatefulWidget { | ||
| const GoogleMap({ | ||
| @required this.initialCameraPosition, | ||
|
|
@@ -22,6 +31,9 @@ class GoogleMap extends StatefulWidget { | |
| this.trackCameraPosition = false, | ||
| this.myLocationEnabled = false, | ||
| this.markers, | ||
| this.onCameraMoveStarted, | ||
| this.onCameraMove, | ||
| this.onCameraIdle, | ||
| }) : assert(initialCameraPosition != null); | ||
|
|
||
| final MapCreatedCallback onMapCreated; | ||
|
|
@@ -58,9 +70,34 @@ 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; | ||
|
|
||
| /// Called when the camera starts moving. | ||
| /// | ||
| /// This can be initiated by the following: | ||
| /// 1. Non-gesture animation initiated in response to user actions. | ||
| /// For example: zoom buttons, my location button, or marker clicks. | ||
| /// 2. Programmatically initiated animation. | ||
| /// 3. Camera motion initiated in response to user gestures on the map. | ||
| /// For example: pan, tilt, pinch to zoom, or rotate. | ||
| /// | ||
| /// Note: This is callback is called even if [trackCameraPosition] is false. | ||
| final VoidCallback onCameraMoveStarted; | ||
|
|
||
| /// Called repeatedly as the camera continues to move after an | ||
| /// onCameraMoveStarted call. | ||
| /// | ||
| /// This may be called as often as once every frame and should | ||
| /// not perform expensive operations. | ||
| /// | ||
| /// This is only called if [trackCameraPosition] is true. | ||
| final CameraPositionCallback onCameraMove; | ||
|
|
||
| /// Called when camera movement has ended, there are no pending | ||
| /// animations and the user has stopped interacting with the map. | ||
| final VoidCallback onCameraIdle; | ||
|
|
||
| /// True if a "My Location" layer should be shown on the map. | ||
| /// | ||
| /// This layer includes a location indicator at the current device location, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ name: google_maps_flutter | |
| description: A Flutter plugin for integrating Google Maps in iOS and Android applications. | ||
| author: Flutter Team <[email protected]> | ||
| homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter | ||
| version: 0.3.0+3 | ||
| version: 0.4.0 | ||
|
|
||
| dependencies: | ||
| flutter: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!