Update hello_world example to new template (#10287)

diff --git a/examples/hello_world/android/app/src/main/java/io/flutter/examples/hello_world/MainActivity.java b/examples/hello_world/android/app/src/main/java/io/flutter/examples/hello_world/MainActivity.java
index 6bb0df1..34dd67f 100644
--- a/examples/hello_world/android/app/src/main/java/io/flutter/examples/hello_world/MainActivity.java
+++ b/examples/hello_world/android/app/src/main/java/io/flutter/examples/hello_world/MainActivity.java
@@ -2,15 +2,12 @@
 
 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);
-    }
+  @Override
+  protected void onCreate(Bundle savedInstanceState) {
+    super.onCreate(savedInstanceState);
+    GeneratedPluginRegistrant.registerWith(this);
+  }
 }
diff --git a/examples/hello_world/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/examples/hello_world/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
new file mode 100644
index 0000000..e07931d
--- /dev/null
+++ b/examples/hello_world/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
@@ -0,0 +1,11 @@
+package io.flutter.plugins;
+
+import io.flutter.plugin.common.PluginRegistry;
+
+/**
+ * Generated file. Do not edit.
+ */
+public final class GeneratedPluginRegistrant {
+  public static void registerWith(PluginRegistry registry) {
+  }
+}
diff --git a/examples/hello_world/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java b/examples/hello_world/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java
deleted file mode 100644
index 92f7a74..0000000
--- a/examples/hello_world/android/app/src/main/java/io/flutter/plugins/PluginRegistry.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package io.flutter.plugins;
-
-import io.flutter.app.FlutterActivity;
-
-
-/**
- * Generated file. Do not edit.
- */
-
-public class PluginRegistry {
-
-    public void registerAll(FlutterActivity activity) {
-    }
-}
diff --git a/examples/hello_world/ios/Runner.xcodeproj/project.pbxproj b/examples/hello_world/ios/Runner.xcodeproj/project.pbxproj
index 42113bc..0a9a6fd 100644
--- a/examples/hello_world/ios/Runner.xcodeproj/project.pbxproj
+++ b/examples/hello_world/ios/Runner.xcodeproj/project.pbxproj
@@ -7,10 +7,10 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		1498D2341E8E89220040F4C2 /* PluginRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* PluginRegistry.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, ); }; };
+		74E793081ED576700031D088 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 74E793071ED576700031D088 /* GeneratedPluginRegistrant.m */; };
 		9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
 		9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
@@ -39,10 +39,10 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
-		1498D2321E8E86230040F4C2 /* PluginRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PluginRegistry.h; sourceTree = "<group>"; };
-		1498D2331E8E89220040F4C2 /* PluginRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PluginRegistry.m; sourceTree = "<group>"; };
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
 		3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
+		74E793061ED576700031D088 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
+		74E793071ED576700031D088 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
 		7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -106,6 +106,8 @@
 		97C146F01CF9000F007C117D /* Runner */ = {
 			isa = PBXGroup;
 			children = (
+				74E793061ED576700031D088 /* GeneratedPluginRegistrant.h */,
+				74E793071ED576700031D088 /* GeneratedPluginRegistrant.m */,
 				7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
 				7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
 				97C146FA1CF9000F007C117D /* Main.storyboard */,
@@ -113,8 +115,6 @@
 				97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
 				97C147021CF9000F007C117D /* Info.plist */,
 				97C146F11CF9000F007C117D /* Supporting Files */,
-				1498D2321E8E86230040F4C2 /* PluginRegistry.h */,
-				1498D2331E8E89220040F4C2 /* PluginRegistry.m */,
 			);
 			path = Runner;
 			sourceTree = "<group>";
@@ -244,7 +244,7 @@
 			files = (
 				978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
 				97C146F31CF9000F007C117D /* main.m in Sources */,
-				1498D2341E8E89220040F4C2 /* PluginRegistry.m in Sources */,
+				74E793081ED576700031D088 /* GeneratedPluginRegistrant.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/examples/hello_world/ios/Runner/AppDelegate.m b/examples/hello_world/ios/Runner/AppDelegate.m
index f78a1ac..b1a0c02 100644
--- a/examples/hello_world/ios/Runner/AppDelegate.m
+++ b/examples/hello_world/ios/Runner/AppDelegate.m
@@ -1,38 +1,11 @@
 #include "AppDelegate.h"
-#include "PluginRegistry.h"
+#include "GeneratedPluginRegistrant.h"
 
-@implementation AppDelegate {
-  PluginRegistry *plugins;
-}
+@implementation AppDelegate
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+  [GeneratedPluginRegistrant registerWithRegistry:self];
   // Override point for customization after application launch.
-  FlutterViewController *flutterController =
-      (FlutterViewController *)self.window.rootViewController;
-  plugins = [[PluginRegistry alloc] initWithController:flutterController];
-  return YES;
+  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/hello_world/ios/Runner/GeneratedPluginRegistrant.h b/examples/hello_world/ios/Runner/GeneratedPluginRegistrant.h
new file mode 100644
index 0000000..3b700eb
--- /dev/null
+++ b/examples/hello_world/ios/Runner/GeneratedPluginRegistrant.h
@@ -0,0 +1,14 @@
+//
+//  Generated file. Do not edit.
+//
+
+#ifndef GeneratedPluginRegistrant_h
+#define GeneratedPluginRegistrant_h
+
+#import <Flutter/Flutter.h>
+
+@interface GeneratedPluginRegistrant : NSObject
++ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
+@end
+
+#endif /* GeneratedPluginRegistrant_h */
diff --git a/examples/hello_world/ios/Runner/GeneratedPluginRegistrant.m b/examples/hello_world/ios/Runner/GeneratedPluginRegistrant.m
new file mode 100644
index 0000000..60dfa42
--- /dev/null
+++ b/examples/hello_world/ios/Runner/GeneratedPluginRegistrant.m
@@ -0,0 +1,12 @@
+//
+//  Generated file. Do not edit.
+//
+
+#import "GeneratedPluginRegistrant.h"
+
+@implementation GeneratedPluginRegistrant
+
++ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
+}
+
+@end
diff --git a/examples/hello_world/ios/Runner/PluginRegistry.h b/examples/hello_world/ios/Runner/PluginRegistry.h
deleted file mode 100644
index df039db..0000000
--- a/examples/hello_world/ios/Runner/PluginRegistry.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-//  Generated file. Do not edit.
-//
-
-#ifndef PluginRegistry_h
-#define PluginRegistry_h
-
-#import <Flutter/Flutter.h>
-
-
-@interface PluginRegistry : NSObject
-
-
-- (instancetype)initWithController:(FlutterViewController *)controller;
-
-@end
-
-#endif /* PluginRegistry_h */
diff --git a/examples/hello_world/ios/Runner/PluginRegistry.m b/examples/hello_world/ios/Runner/PluginRegistry.m
deleted file mode 100644
index 0a34729..0000000
--- a/examples/hello_world/ios/Runner/PluginRegistry.m
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-//  Generated file. Do not edit.
-//
-
-#import "PluginRegistry.h"
-
-@implementation PluginRegistry
-
-- (instancetype)initWithController:(FlutterViewController *)controller {
-  if (self = [super init]) {
-  }
-  return self;
-}
-
-@end
diff --git a/examples/hello_world/ios/Runner/main.m b/examples/hello_world/ios/Runner/main.m
index a9220f1..100e05e 100644
--- a/examples/hello_world/ios/Runner/main.m
+++ b/examples/hello_world/ios/Runner/main.m
@@ -7,8 +7,7 @@
 #import "AppDelegate.h"
 
 int main(int argc, char * argv[]) {
-    @autoreleasepool {
-        return UIApplicationMain(argc, argv, nil,
-                                 NSStringFromClass([AppDelegate class]));
-    }
+  @autoreleasepool {
+    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
+  }
 }