From 05a3263eb40b1d461afe79bfd4c0af9fef883e59 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Fri, 29 Oct 2021 09:41:23 -0700 Subject: [PATCH] Add plugin and host registration to multiple_flutters example (#942) --- .../app/src/main/AndroidManifest.xml | 8 ++ .../SingleFlutterViewController.swift | 2 + .../multiple_flutters_ios/Podfile | 6 +- .../multiple_flutters_ios/Podfile.lock | 13 +++- .../multiple_flutters_module/lib/main.dart | 12 +++ .../multiple_flutters_module/pubspec.lock | 74 +++++++++++++++++-- .../multiple_flutters_module/pubspec.yaml | 1 + 7 files changed, 104 insertions(+), 12 deletions(-) diff --git a/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/AndroidManifest.xml b/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/AndroidManifest.xml index 734b96c27..2d542b347 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/AndroidManifest.xml +++ b/add_to_app/multiple_flutters/multiple_flutters_android/app/src/main/AndroidManifest.xml @@ -2,6 +2,14 @@ + + + + + + + + runApp(const MyApp(color: Colors.blue)); @@ -90,6 +91,17 @@ class _MyHomePageState extends State { }, child: const Text('Next'), ), + ElevatedButton( + onPressed: () async { + // Use the url_launcher plugin to open the Flutter docs in + // a browser. + const url = 'https://flutter.dev/docs'; + if (await launcher.canLaunch(url)) { + launcher.launch(url); + } + }, + child: const Text('Open Flutter Docs'), + ), ], ), ), diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock index 750761f76..2fc7f1207 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock +++ b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,7 +21,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -74,6 +74,18 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" lints: dependency: transitive description: @@ -87,7 +99,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" meta: dependency: transitive description: @@ -102,6 +114,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" sky_engine: dependency: transitive description: flutter @@ -148,7 +167,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.3" typed_data: dependency: transitive description: @@ -156,12 +175,55 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.12" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.5.0" diff --git a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml index a190761e2..26b8bed63 100644 --- a/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml +++ b/add_to_app/multiple_flutters/multiple_flutters_module/pubspec.yaml @@ -9,6 +9,7 @@ environment: dependencies: flutter: sdk: flutter + url_launcher: ^6.0.6 cupertino_icons: ^1.0.0