Skip to content

Commit 73c3de3

Browse files
author
Gray Mackall
committed
additional removals in google_maps
1 parent c2e4c87 commit 73c3de3

File tree

1 file changed

+5
-6
lines changed
  • packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps

1 file changed

+5
-6
lines changed

packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@
3333
import java.util.Map;
3434
import java.util.Set;
3535

36+
import io.flutter.FlutterInjector;
37+
3638
/** Conversions between JSON-like values and GoogleMaps data types. */
3739
class Convert {
3840

39-
// TODO(hamdikahloun): FlutterMain has been deprecated and should be replaced with FlutterLoader
40-
// when it's available in Stable channel: https://github.com/flutter/flutter/issues/70923.
41-
@SuppressWarnings("deprecation")
4241
private static BitmapDescriptor toBitmapDescriptor(Object o) {
4342
final List<?> data = toList(o);
4443
switch (toString(data.get(0))) {
@@ -51,16 +50,16 @@ private static BitmapDescriptor toBitmapDescriptor(Object o) {
5150
case "fromAsset":
5251
if (data.size() == 2) {
5352
return BitmapDescriptorFactory.fromAsset(
54-
io.flutter.view.FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
53+
FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(toString(data.get(1))));
5554
} else {
5655
return BitmapDescriptorFactory.fromAsset(
57-
io.flutter.view.FlutterMain.getLookupKeyForAsset(
56+
FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(
5857
toString(data.get(1)), toString(data.get(2))));
5958
}
6059
case "fromAssetImage":
6160
if (data.size() == 3) {
6261
return BitmapDescriptorFactory.fromAsset(
63-
io.flutter.view.FlutterMain.getLookupKeyForAsset(toString(data.get(1))));
62+
FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(toString(data.get(1))));
6463
} else {
6564
throw new IllegalArgumentException(
6665
"'fromAssetImage' Expected exactly 3 arguments, got: " + data.size());

0 commit comments

Comments
 (0)