diff --git a/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java b/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java index f690c3b2158..f0128fd89f6 100644 --- a/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java +++ b/examples/flutter_gallery/android/app/src/main/java/io/flutter/examples/gallery/MainActivity.java @@ -3,15 +3,13 @@ package io.flutter.examples.gallery; import android.os.Bundle; import io.flutter.app.FlutterActivity; -import io.flutter.plugins.PluginRegistry; +import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { - PluginRegistry pluginRegistry; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - pluginRegistry = new PluginRegistry(); - pluginRegistry.registerAll(this); + GeneratedPluginRegistrant.registerWith(this); } } diff --git a/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java new file mode 100644 index 00000000000..dad46d89f1c --- /dev/null +++ b/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -0,0 +1,13 @@ +package io.flutter.plugins; + +import io.flutter.plugin.common.PluginRegistry; +import io.flutter.plugins.url_launcher.UrlLauncherPlugin; + +/** + * Generated file. Do not edit. + */ +public final class GeneratedPluginRegistrant { + public static void registerWith(PluginRegistry registry) { + UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.url_launcher.UrlLauncherPlugin")); + } +} diff --git a/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java b/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java deleted file mode 100644 index 846c01bc50c..00000000000 --- a/examples/flutter_gallery/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.flutter.plugins; - -import io.flutter.app.FlutterActivity; - -import io.flutter.plugins.url_launcher.UrlLauncherPlugin; - -/** - * Generated file. Do not edit. - */ - -public class PluginRegistry { - public UrlLauncherPlugin url_launcher; - - public void registerAll(FlutterActivity activity) { - url_launcher = UrlLauncherPlugin.register(activity); - } -} diff --git a/examples/flutter_gallery/ios/Runner.xcodeproj/project.pbxproj b/examples/flutter_gallery/ios/Runner.xcodeproj/project.pbxproj index cb8829916f9..daa3777e7f7 100644 --- a/examples/flutter_gallery/ios/Runner.xcodeproj/project.pbxproj +++ b/examples/flutter_gallery/ios/Runner.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* PluginRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* PluginRegistry.m */; }; + 2D9222451EC1E1BA007564B0 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9222441EC1E1BA007564B0 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -21,6 +21,7 @@ 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + B9547808190DA20F9240F106 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 574561ACCA7586E5CB2F018C /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -39,10 +40,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* PluginRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PluginRegistry.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* PluginRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PluginRegistry.m; sourceTree = ""; }; + 2D9222431EC1E1BA007564B0 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 2D9222441EC1E1BA007564B0 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; + 574561ACCA7586E5CB2F018C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -65,6 +67,7 @@ files = ( 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, + B9547808190DA20F9240F106 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -92,6 +95,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, + E54E8B7296D73DD9B2385312 /* Pods */, ); sourceTree = ""; }; @@ -106,6 +110,8 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 2D9222431EC1E1BA007564B0 /* GeneratedPluginRegistrant.h */, + 2D9222441EC1E1BA007564B0 /* GeneratedPluginRegistrant.m */, 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 97C146FA1CF9000F007C117D /* Main.storyboard */, @@ -113,8 +119,6 @@ 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C147021CF9000F007C117D /* Info.plist */, 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* PluginRegistry.h */, - 1498D2331E8E89220040F4C2 /* PluginRegistry.m */, ); path = Runner; sourceTree = ""; @@ -130,10 +134,18 @@ CF3B75C9A7D2FA2A4C99F110 /* Frameworks */ = { isa = PBXGroup; children = ( + 574561ACCA7586E5CB2F018C /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; }; + E54E8B7296D73DD9B2385312 /* Pods */ = { + isa = PBXGroup; + children = ( + ); + name = Pods; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -141,12 +153,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 91D60C3C5625D9810FC8B9A8 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 9935C741A3A9624590A8630E /* [CP] Embed Pods Frameworks */, + C8BD70C2FED75D00708581C5 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -221,6 +236,21 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; }; + 91D60C3C5625D9810FC8B9A8 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -235,6 +265,36 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + 9935C741A3A9624590A8630E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C8BD70C2FED75D00708581C5 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -244,7 +304,7 @@ files = ( 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* PluginRegistry.m in Sources */, + 2D9222451EC1E1BA007564B0 /* GeneratedPluginRegistrant.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -377,7 +437,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.flutterGallery"; + PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flutterGallery; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -399,7 +459,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = "com.yourcompany.flutterGallery"; + PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flutterGallery; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/examples/flutter_gallery/ios/Runner.xcworkspace/contents.xcworkspacedata b/examples/flutter_gallery/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16ed0..21a3cc14c74 100644 --- a/examples/flutter_gallery/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/examples/flutter_gallery/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/examples/flutter_gallery/ios/Runner/AppDelegate.m b/examples/flutter_gallery/ios/Runner/AppDelegate.m index f78a1acfd3d..ef69bf55910 100644 --- a/examples/flutter_gallery/ios/Runner/AppDelegate.m +++ b/examples/flutter_gallery/ios/Runner/AppDelegate.m @@ -1,38 +1,10 @@ #include "AppDelegate.h" -#include "PluginRegistry.h" +#include "GeneratedPluginRegistrant.h" -@implementation AppDelegate { - PluginRegistry *plugins; -} +@implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - FlutterViewController *flutterController = - (FlutterViewController *)self.window.rootViewController; - plugins = [[PluginRegistry alloc] initWithController:flutterController]; - return YES; + [GeneratedPluginRegistrant registerWithRegistry:self]; + return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - -- (void)applicationWillResignActive:(UIApplication *)application { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - @end diff --git a/examples/flutter_gallery/ios/Runner/GeneratedPluginRegistrant.h b/examples/flutter_gallery/ios/Runner/GeneratedPluginRegistrant.h new file mode 100644 index 00000000000..1a02b748de1 --- /dev/null +++ b/examples/flutter_gallery/ios/Runner/GeneratedPluginRegistrant.h @@ -0,0 +1,16 @@ +// +// Generated file. Do not edit. +// + +#ifndef GeneratedPluginRegistrant_h +#define GeneratedPluginRegistrant_h + +#import + +#import "UrlLauncherPlugin.h" + +@interface GeneratedPluginRegistrant : NSObject ++ (void)registerWithRegistry:(NSObject*)registry; +@end + +#endif /* GeneratedPluginRegistrant_h */ diff --git a/examples/flutter_gallery/ios/Runner/GeneratedPluginRegistrant.m b/examples/flutter_gallery/ios/Runner/GeneratedPluginRegistrant.m new file mode 100644 index 00000000000..6f31e9af4c9 --- /dev/null +++ b/examples/flutter_gallery/ios/Runner/GeneratedPluginRegistrant.m @@ -0,0 +1,13 @@ +// +// Generated file. Do not edit. +// + +#import "GeneratedPluginRegistrant.h" + +@implementation GeneratedPluginRegistrant + ++ (void)registerWithRegistry:(NSObject*)registry { + [UrlLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"UrlLauncherPlugin"]]; +} + +@end diff --git a/examples/flutter_gallery/ios/Runner/PluginRegistry.h b/examples/flutter_gallery/ios/Runner/PluginRegistry.h deleted file mode 100644 index 34a61745682..00000000000 --- a/examples/flutter_gallery/ios/Runner/PluginRegistry.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// Generated file. Do not edit. -// - -#ifndef PluginRegistry_h -#define PluginRegistry_h - -#import - -#import "UrlLauncherPlugin.h" - -@interface PluginRegistry : NSObject - -@property (readonly, nonatomic) UrlLauncherPlugin *url_launcher; - -- (instancetype)initWithController:(FlutterViewController *)controller; - -@end - -#endif /* PluginRegistry_h */ diff --git a/examples/flutter_gallery/ios/Runner/PluginRegistry.m b/examples/flutter_gallery/ios/Runner/PluginRegistry.m deleted file mode 100644 index 1bb042ddd60..00000000000 --- a/examples/flutter_gallery/ios/Runner/PluginRegistry.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// Generated file. Do not edit. -// - -#import "PluginRegistry.h" - -@implementation PluginRegistry - -- (instancetype)initWithController:(FlutterViewController *)controller { - if (self = [super init]) { - _url_launcher = [[UrlLauncherPlugin alloc] initWithController:controller]; - } - return self; -} - -@end diff --git a/examples/flutter_gallery/pubspec.yaml b/examples/flutter_gallery/pubspec.yaml index 0e94e028d9a..29c8501cd67 100644 --- a/examples/flutter_gallery/pubspec.yaml +++ b/examples/flutter_gallery/pubspec.yaml @@ -6,7 +6,7 @@ dependencies: flutter: sdk: flutter - url_launcher: ^0.3.3 + url_launcher: ^0.4.0 # Also update dev/benchmarks/complex_layout/pubspec.yaml flutter_gallery_assets: