From b9bcbd66bb148a6eec936be543c1653d08a55a4e Mon Sep 17 00:00:00 2001 From: Xiao Yu Date: Sun, 16 Jun 2019 16:20:20 -0700 Subject: [PATCH 1/2] some drive by docs while I was reading the embedding classes --- .../embedding/engine/FlutterEngine.java | 3 +++ .../framework/Headers/FlutterViewController.h | 22 ++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java b/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java index 8f799ef49721d..1e0f2bda56705 100644 --- a/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java +++ b/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java @@ -110,6 +110,9 @@ public void onPreEngineRestart() { /** * Constructs a new {@code FlutterEngine}. * + * {@code FlutterMain.startInitialization} must be called before constructing a FlutterEngine + * to load the native libraries needed to attach to JNI. + * * A new {@code FlutterEngine} does not execute any Dart code automatically. See * {@link #getDartExecutor()} and {@link DartExecutor#executeDartEntrypoint(DartExecutor.DartEntrypoint)} * to begin executing Dart code within this {@code FlutterEngine}. diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h index fc2687c4456b3..ddbb87aa62e14 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h @@ -29,16 +29,18 @@ extern NSNotificationName const FlutterSemanticsUpdateNotification; /** * A `UIViewController` implementation for Flutter views. * - * Dart execution, channel communication, texture registration, and plugin registration - * are all handled by `FlutterEngine`. Calls on this class to those members all proxy - * through to the `FlutterEngine` attached FlutterViewController. - * - * A FlutterViewController can be initialized either with an already-running `FlutterEngine`, - * or it can be initialized with a `FlutterDartProject` that will be used to spin up - * a new `FlutterEngine`. Developers looking to present and hide FlutterViewControllers - * in native iOS applications will usually want to maintain the `FlutterEngine` instance - * so as not to lose Dart-related state and asynchronous tasks when navigating back and - * forth between a FlutterViewController and other `UIViewController`s. + * Dart execution, channel communication, texture registration, and plugin registration are all + * handled by `FlutterEngine`. Calls on this class to those members all proxy through to the + * `FlutterEngine` attached FlutterViewController. + * + * A FlutterViewController can be initialized either with an already-running `FlutterEngine` via + * the `initWithEngine:` initializer, or it can be initialized with a `FlutterDartProject` that + * will be used to implicitly spin up a new `FlutterEngine`. Creating a `FlutterEngine before + * showing a `FlutterViewController` can be used to pre-initialize the Dart VM and to prepare the + * isolate in order to reduce the latency to the first rendered frame. Holding a `FlutterEngine` + * independently of FlutterViewControllers can also be used to not to lose Dart-related state and + * asynchronous tasks when navigating back and forth between a FlutterViewController and other + * `UIViewController`s. */ FLUTTER_EXPORT @interface FlutterViewController : UIViewController From ab85261831bf9e9db04dbaad2dc3b6c106118c70 Mon Sep 17 00:00:00 2001 From: Xiao Yu Date: Wed, 14 Aug 2019 15:05:54 -0700 Subject: [PATCH 2/2] formatting --- .../android/io/flutter/embedding/engine/FlutterEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java b/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java index 1e0f2bda56705..3c91fdd3a1050 100644 --- a/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java +++ b/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java @@ -110,7 +110,7 @@ public void onPreEngineRestart() { /** * Constructs a new {@code FlutterEngine}. * - * {@code FlutterMain.startInitialization} must be called before constructing a FlutterEngine + * {@code FlutterMain.startInitialization} must be called before constructing a {@code FlutterEngine} * to load the native libraries needed to attach to JNI. * * A new {@code FlutterEngine} does not execute any Dart code automatically. See