Skip to content

Commit

Permalink
[google_maps_flutter] Improve widget build performance
Browse files Browse the repository at this point in the history
The widget build was serializing the widget parameters each frame even though in the useAndroidSurface case they were only being used for creation (updates being done through didUpdateWidget). Use late initialization to skip serialization if not needed.
  • Loading branch information
AsturaPhoenix committed Apr 3, 2023
1 parent 254f4bf commit 3d81186
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform {
MapObjects mapObjects = const MapObjects(),
Map<String, dynamic> mapOptions = const <String, dynamic>{},
}) {
final Map<String, dynamic> creationParams = <String, dynamic>{
late final Map<String, dynamic> creationParams = <String, dynamic>{
'initialCameraPosition':
widgetConfiguration.initialCameraPosition.toMap(),
'options': mapOptions,
Expand Down

0 comments on commit 3d81186

Please sign in to comment.