Classes

The following classes are available globally.

  • UIApplicationDelegate subclass for simple apps that want default behavior.

    This class implements the following behaviors:

    • Status bar touches are forwarded to the key window’s root view FlutterViewController, in order to trigger scroll to top.
    • Keeps the Flutter connection open in debug mode when the phone screen locks.

    App delegates for Flutter applications are not required to inherit from this class. Developers of custom app delegate classes should copy and paste code as necessary from FlutterAppDelegate.mm.

    See more

    Declaration

    Objective-C

    @interface FlutterAppDelegate
        : UIResponder <UIApplicationDelegate, FlutterPluginRegistry,
                       FlutterAppLifeCycleProvider>
  • The FlutterEngine class coordinates a single instance of execution for a FlutterDartProject. It may have zero or one FlutterViewController at a time, which can be specified via -setViewController:. FlutterViewController‘s initWithEngine initializer will automatically call -setViewController: for itself.

    A FlutterEngine can be created independently of a FlutterViewController for headless execution. It can also persist across the lifespan of multiple FlutterViewController instances to maintain state and/or asynchronous tasks (such as downloading a large file).

    Alternatively, you can simply create a new FlutterViewController with only a FlutterDartProject. That FlutterViewController will internally manage its own instance of a FlutterEngine, but will not guarantee survival of the engine beyond the life of the ViewController.

    A newly initialized FlutterEngine will not actually run a Dart Isolate until either -runWithEntrypoint: or -runWithEntrypoint:libraryURI is invoked. One of these methods must be invoked before calling -setViewController:.

    See more

    Declaration

    Objective-C

    @interface FlutterEngine : NSObject
  • 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 UIViewControllers.

    See more

    Declaration

    Objective-C

    @interface FlutterViewController : UIViewController