|
1 | 1 | package io.flutter.plugins; |
2 | 2 |
|
3 | | -import androidx.annotation.Keep; |
4 | | -import androidx.annotation.NonNull; |
5 | | -import io.flutter.Log; |
6 | | - |
7 | | -import io.flutter.embedding.engine.FlutterEngine; |
| 3 | +import io.flutter.plugin.common.PluginRegistry; |
| 4 | +import io.flutter.plugins.pathprovider.PathProviderPlugin; |
| 5 | +import io.flutter.plugins.urllauncher.UrlLauncherPlugin; |
8 | 6 |
|
9 | 7 | /** |
10 | 8 | * Generated file. Do not edit. |
11 | | - * This file is generated by the Flutter tool based on the |
12 | | - * plugins that support the Android platform. |
13 | 9 | */ |
14 | | -@Keep |
15 | 10 | public final class GeneratedPluginRegistrant { |
16 | | - private static final String TAG = "GeneratedPluginRegistrant"; |
17 | | - public static void registerWith(@NonNull FlutterEngine flutterEngine) { |
18 | | - try { |
19 | | - flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin()); |
20 | | - } catch(Exception e) { |
21 | | - Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e); |
22 | | - } |
23 | | - try { |
24 | | - flutterEngine.getPlugins().add(new com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin()); |
25 | | - } catch(Exception e) { |
26 | | - Log.e(TAG, "Error registering plugin syncfusion_flutter_pdfviewer, com.syncfusion.flutter.pdfviewer.SyncfusionFlutterPdfViewerPlugin", e); |
| 11 | + public static void registerWith(PluginRegistry registry) { |
| 12 | + if (alreadyRegisteredWith(registry)) { |
| 13 | + return; |
27 | 14 | } |
28 | | - try { |
29 | | - flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin()); |
30 | | - } catch(Exception e) { |
31 | | - Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e); |
| 15 | + PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); |
| 16 | + UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); |
| 17 | + } |
| 18 | + |
| 19 | + private static boolean alreadyRegisteredWith(PluginRegistry registry) { |
| 20 | + final String key = GeneratedPluginRegistrant.class.getCanonicalName(); |
| 21 | + if (registry.hasPlugin(key)) { |
| 22 | + return true; |
32 | 23 | } |
| 24 | + registry.registrarFor(key); |
| 25 | + return false; |
33 | 26 | } |
34 | 27 | } |
0 commit comments