mirror of
https://github.com/flutter/samples.git
synced 2025-11-08 13:58:47 +00:00
Add plugin and host registration to multiple_flutters example (#942)
This commit is contained in:
@@ -2,6 +2,14 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="dev.flutter.multipleflutters">
|
package="dev.flutter.multipleflutters">
|
||||||
|
|
||||||
|
<!-- Provide required visibility configuration for API level 30 and above -->
|
||||||
|
<queries>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<data android:scheme="https" />
|
||||||
|
</intent>
|
||||||
|
</queries>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".App"
|
android:name=".App"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import Flutter
|
import Flutter
|
||||||
|
import FlutterPluginRegistrant
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// A FlutterViewController intended for the MyApp widget in the Flutter module.
|
/// A FlutterViewController intended for the MyApp widget in the Flutter module.
|
||||||
@@ -16,6 +17,7 @@ class SingleFlutterViewController: FlutterViewController, DataModelObserver {
|
|||||||
init(withEntrypoint entryPoint: String?) {
|
init(withEntrypoint entryPoint: String?) {
|
||||||
let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
|
let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
|
||||||
let newEngine = appDelegate.engines.makeEngine(withEntrypoint: entryPoint, libraryURI: nil)
|
let newEngine = appDelegate.engines.makeEngine(withEntrypoint: entryPoint, libraryURI: nil)
|
||||||
|
GeneratedPluginRegistrant.register(with: newEngine)
|
||||||
super.init(engine: newEngine, nibName: nil, bundle: nil)
|
super.init(engine: newEngine, nibName: nil, bundle: nil)
|
||||||
DataModel.shared.addObserver(observer: self)
|
DataModel.shared.addObserver(observer: self)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Uncomment the next line to define a global platform for your project
|
# Copyright 2021 The Flutter team. All rights reserved.
|
||||||
# platform :ios, '9.0'
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
flutter_application_path = '../multiple_flutters_module'
|
flutter_application_path = '../multiple_flutters_module'
|
||||||
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
|
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
|
||||||
|
|
||||||
target 'MultipleFluttersIos' do
|
target 'MultipleFluttersIos' do
|
||||||
# Comment the next line if you don't want to use dynamic frameworks
|
|
||||||
use_frameworks!
|
use_frameworks!
|
||||||
install_all_flutter_pods(flutter_application_path)
|
install_all_flutter_pods(flutter_application_path)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,13 +2,17 @@ PODS:
|
|||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- FlutterPluginRegistrant (0.0.1):
|
- FlutterPluginRegistrant (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- url_launcher
|
||||||
- multiple_flutters_module (0.0.1):
|
- multiple_flutters_module (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- url_launcher (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- Flutter (from `../multiple_flutters_module/.ios/Flutter/engine`)
|
- Flutter (from `../multiple_flutters_module/.ios/Flutter/engine`)
|
||||||
- FlutterPluginRegistrant (from `../multiple_flutters_module/.ios/Flutter/FlutterPluginRegistrant`)
|
- FlutterPluginRegistrant (from `../multiple_flutters_module/.ios/Flutter/FlutterPluginRegistrant`)
|
||||||
- multiple_flutters_module (from `../multiple_flutters_module/.ios/Flutter`)
|
- multiple_flutters_module (from `../multiple_flutters_module/.ios/Flutter`)
|
||||||
|
- url_launcher (from `../multiple_flutters_module/.ios/.symlinks/plugins/url_launcher/ios`)
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
Flutter:
|
Flutter:
|
||||||
@@ -17,12 +21,15 @@ EXTERNAL SOURCES:
|
|||||||
:path: "../multiple_flutters_module/.ios/Flutter/FlutterPluginRegistrant"
|
:path: "../multiple_flutters_module/.ios/Flutter/FlutterPluginRegistrant"
|
||||||
multiple_flutters_module:
|
multiple_flutters_module:
|
||||||
:path: "../multiple_flutters_module/.ios/Flutter"
|
:path: "../multiple_flutters_module/.ios/Flutter"
|
||||||
|
url_launcher:
|
||||||
|
:path: "../multiple_flutters_module/.ios/.symlinks/plugins/url_launcher/ios"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
Flutter: bdfa2e8fe0e2880a2c6a58a0b1a8675c262a07af
|
Flutter: bdfa2e8fe0e2880a2c6a58a0b1a8675c262a07af
|
||||||
FlutterPluginRegistrant: 2afd5ea46d3a949472c9b7da6462d8fbf7d8b16e
|
FlutterPluginRegistrant: d0de10c7c4fc31cc6b676a5965b96100f7c035f7
|
||||||
multiple_flutters_module: fdf461a0e4225614d475110d85db6fd6de5aeff1
|
multiple_flutters_module: fdf461a0e4225614d475110d85db6fd6de5aeff1
|
||||||
|
url_launcher: b6e016d912f04be9f5bf6e8e82dc599b7ba59649
|
||||||
|
|
||||||
PODFILE CHECKSUM: d7f39981f450db398859f05de2475ec53909a487
|
PODFILE CHECKSUM: 91c00dfcff6ea3b8d853bf0c2411672a01ca993c
|
||||||
|
|
||||||
COCOAPODS: 1.10.1
|
COCOAPODS: 1.11.2
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart' as launcher;
|
||||||
|
|
||||||
void main() => runApp(const MyApp(color: Colors.blue));
|
void main() => runApp(const MyApp(color: Colors.blue));
|
||||||
|
|
||||||
@@ -90,6 +91,17 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
},
|
},
|
||||||
child: const Text('Next'),
|
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'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.8.1"
|
version: "2.8.2"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -21,7 +21,7 @@ packages:
|
|||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -74,6 +74,18 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
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:
|
lints:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -87,7 +99,7 @@ packages:
|
|||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.10"
|
version: "0.12.11"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -102,6 +114,13 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.8.0"
|
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:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -148,7 +167,7 @@ packages:
|
|||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.4.2"
|
version: "0.4.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -156,12 +175,55 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
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:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0 <3.0.0"
|
dart: ">=2.14.0 <3.0.0"
|
||||||
|
flutter: ">=2.5.0"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
url_launcher: ^6.0.6
|
||||||
|
|
||||||
cupertino_icons: ^1.0.0
|
cupertino_icons: ^1.0.0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user