Skip to content

Commit d318693

Browse files
committed
Address background color review feedback
1 parent dffba86 commit d318693

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,7 @@ PlatformMarkerType _platformMarkerTypeFromMarkerType(MarkerType markerType) {
12431243
}
12441244

12451245
PlatformMapConfiguration _platformMapConfigurationFromMapConfiguration(MapConfiguration config) {
1246+
final Color? backgroundColor = config.backgroundColor;
12461247
return PlatformMapConfiguration(
12471248
compassEnabled: config.compassEnabled,
12481249
cameraTargetBounds: _platformCameraTargetBoundsFromCameraTargetBounds(
@@ -1267,9 +1268,9 @@ PlatformMapConfiguration _platformMapConfigurationFromMapConfiguration(MapConfig
12671268
markerType: _platformMarkerTypeFromMarkerType(config.markerType ?? MarkerType.marker),
12681269
mapId: config.mapId,
12691270
style: config.style,
1270-
backgroundColor: config.backgroundColor == null
1271+
backgroundColor: backgroundColor == null
12711272
? null
1272-
: PlatformColor(argbValue: config.backgroundColor!.toARGB32()),
1273+
: PlatformColor(argbValue: backgroundColor.toARGB32()),
12731274
);
12741275
}
12751276

@@ -1280,6 +1281,7 @@ PlatformMapConfiguration _platformMapConfigurationFromOptionsJson(Map<String, Ob
12801281
// to support this legacy API that relied on cross-package magic strings.
12811282
final List<double>? padding = (options['padding'] as List<Object?>?)?.cast<double>();
12821283
final mapType = options['mapType'] as int?;
1284+
final backgroundColor = options['backgroundColor'] as int?;
12831285
return PlatformMapConfiguration(
12841286
compassEnabled: options['compassEnabled'] as bool?,
12851287
cameraTargetBounds: _platformCameraTargetBoundsFromCameraTargetBoundsJson(
@@ -1313,9 +1315,7 @@ PlatformMapConfiguration _platformMapConfigurationFromOptionsJson(Map<String, Ob
13131315
markerType: PlatformMarkerType.marker,
13141316
mapId: options['mapId'] as String?,
13151317
style: options['style'] as String?,
1316-
backgroundColor: options['backgroundColor'] == null
1317-
? null
1318-
: PlatformColor(argbValue: options['backgroundColor']! as int),
1318+
backgroundColor: backgroundColor == null ? null : PlatformColor(argbValue: backgroundColor),
13191319
);
13201320
}
13211321

‎packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ PlatformEdgeInsets? _platformEdgeInsetsFromEdgeInsets(EdgeInsets? insets) {
11411141
}
11421142

11431143
PlatformMapConfiguration _platformMapConfigurationFromMapConfiguration(MapConfiguration config) {
1144+
final Color? backgroundColor = config.backgroundColor;
11441145
return PlatformMapConfiguration(
11451146
compassEnabled: config.compassEnabled,
11461147
cameraTargetBounds: _platformCameraTargetBoundsFromCameraTargetBounds(
@@ -1162,9 +1163,7 @@ PlatformMapConfiguration _platformMapConfigurationFromMapConfiguration(MapConfig
11621163
markerType: _platformMarkerTypeFromMarkerType(config.markerType ?? MarkerType.marker),
11631164
mapId: config.mapId,
11641165
style: config.style,
1165-
backgroundColor: config.backgroundColor == null
1166-
? null
1167-
: _platformColorFromColor(config.backgroundColor!),
1166+
backgroundColor: backgroundColor == null ? null : _platformColorFromColor(backgroundColor),
11681167
);
11691168
}
11701169

@@ -1192,6 +1191,7 @@ PlatformMapConfiguration _platformMapConfigurationFromOptionsJson(Map<String, Ob
11921191
// to support this legacy API that relied on cross-package magic strings.
11931192
final List<double>? padding = (options['padding'] as List<Object?>?)?.cast<double>();
11941193
final mapType = options['mapType'] as int?;
1194+
final backgroundColor = options['backgroundColor'] as int?;
11951195
return PlatformMapConfiguration(
11961196
compassEnabled: options['compassEnabled'] as bool?,
11971197
cameraTargetBounds: _platformCameraTargetBoundsFromCameraTargetBoundsJson(
@@ -1222,9 +1222,9 @@ PlatformMapConfiguration _platformMapConfigurationFromOptionsJson(Map<String, Ob
12221222
markerType: PlatformMarkerType.marker,
12231223
mapId: options['mapId'] as String?,
12241224
style: options['style'] as String?,
1225-
backgroundColor: options['backgroundColor'] == null
1225+
backgroundColor: backgroundColor == null
12261226
? null
1227-
: _platformColorFromColor(Color(options['backgroundColor']! as int)),
1227+
: _platformColorFromColor(Color(backgroundColor)),
12281228
);
12291229
}
12301230

0 commit comments

Comments
 (0)