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 moreDeclaration
Objective-C
@interface FlutterAppDelegate : UIResponder <UIApplicationDelegate, FlutterPluginRegistry, FlutterAppLifeCycleProvider>
- Status bar touches are forwarded to the key window’s root view
-
An object containing the result of
See moreFlutterCallbackCache
‘slookupCallbackInformation
method.Declaration
Objective-C
@interface FlutterCallbackInformation : NSObject
-
The cache containing callback information for spawning a
See moreFlutterHeadlessDartRunner
.Declaration
Objective-C
@interface FlutterCallbackCache : NSObject
-
A channel for communicating with the Flutter side using basic, asynchronous message passing.
See moreDeclaration
Objective-C
@interface FlutterBasicMessageChannel : NSObject
-
A channel for communicating with the Flutter side using invocation of asynchronous methods.
See moreDeclaration
Objective-C
@interface FlutterMethodChannel : NSObject
-
A channel for communicating with the Flutter side using event streams.
See moreDeclaration
Objective-C
@interface FlutterEventChannel : NSObject
-
A
FlutterMessageCodec
using unencoded binary messages, represented asNSData
instances.This codec is guaranteed to be compatible with the corresponding BinaryCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
On the Dart side, messages are represented using
ByteData
.Declaration
Objective-C
@interface FlutterBinaryCodec : NSObject <FlutterMessageCodec>
-
A
FlutterMessageCodec
using UTF-8 encodedNSString
messages.This codec is guaranteed to be compatible with the corresponding StringCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Declaration
Objective-C
@interface FlutterStringCodec : NSObject <FlutterMessageCodec>
-
A
FlutterMessageCodec
using UTF-8 encoded JSON messages.This codec is guaranteed to be compatible with the corresponding JSONMessageCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Supports values accepted by
NSJSONSerialization
plus top-levelnil
,NSNumber
, andNSString
.On the Dart side, JSON messages are handled by the JSON facilities of the
dart:convert
package.Declaration
Objective-C
@interface FlutterJSONMessageCodec : NSObject <FlutterMessageCodec>
-
A writer of the Flutter standard binary encoding.
See
FlutterStandardMessageCodec
for details on the encoding.The encoding is extensible via subclasses overriding
See morewriteValue
.Declaration
Objective-C
@interface FlutterStandardWriter : NSObject
-
A reader of the Flutter standard binary encoding.
See
FlutterStandardMessageCodec
for details on the encoding.The encoding is extensible via subclasses overriding
See morereadValueOfType
.Declaration
Objective-C
@interface FlutterStandardReader : NSObject
-
A factory of compatible reader/writer instances using the Flutter standard binary encoding or extensions thereof.
See moreDeclaration
Objective-C
@interface FlutterStandardReaderWriter : NSObject
-
A
FlutterMessageCodec
using the Flutter standard binary encoding.This codec is guaranteed to be compatible with the corresponding StandardMessageCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Supported messages are acyclic values of these forms:
nil
orNSNull
NSNumber
(including their representation of Boolean values)NSString
FlutterStandardTypedData
NSArray
of supported valuesNSDictionary
with supported keys and values
On the Dart side, these values are represented as follows:
nil
orNSNull
: nullNSNumber
:bool
,int
, ordouble
, depending on the contained value.NSString
:String
FlutterStandardTypedData
:Uint8List
,Int32List
,Int64List
, orFloat64List
NSArray
:List
NSDictionary
:Map
Declaration
Objective-C
@interface FlutterStandardMessageCodec : NSObject <FlutterMessageCodec>
-
Command object representing a method call on a
See moreFlutterMethodChannel
.Declaration
Objective-C
@interface FlutterMethodCall : NSObject
-
Error object representing an unsuccessful outcome of invoking a method on a
See moreFlutterMethodChannel
, or an error event on aFlutterEventChannel
.Declaration
Objective-C
@interface FlutterError : NSObject
-
A byte buffer holding
UInt8
,SInt32
,SInt64
, orFloat64
values, used withFlutterStandardMessageCodec
andFlutterStandardMethodCodec
.Two’s complement encoding is used for signed integers. IEEE754 double-precision representation is used for floats. The platform’s native endianness is assumed.
See moreDeclaration
Objective-C
@interface FlutterStandardTypedData : NSObject
-
Unavailable
Unavailable on 2018-08-31. Deprecated on 2018-01-09. FlutterStandardBigInteger was needed because the Dart 1.0 int type had no size limit. With Dart 2.0, the int type is a fixed-size, 64-bit signed integer. If you need to communicate larger integers, use NSString encoding instead.
An arbitrarily large integer value, used with
FlutterStandardMessageCodec
andFlutterStandardMethodCodec
.Declaration
Objective-C
@interface FlutterStandardBigInteger : NSObject
-
A
FlutterMethodCodec
using UTF-8 encoded JSON method calls and result envelopes.This codec is guaranteed to be compatible with the corresponding JSONMethodCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Values supported as methods arguments and result payloads are those supported as top-level or leaf values by
FlutterJSONMessageCodec
.Declaration
Objective-C
@interface FlutterJSONMethodCodec : NSObject <FlutterMethodCodec>
-
A
FlutterMethodCodec
using the Flutter standard binary encoding.This codec is guaranteed to be compatible with the corresponding StandardMethodCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.
Values supported as method arguments and result payloads are those supported by
See moreFlutterStandardMessageCodec
.Declaration
Objective-C
@interface FlutterStandardMethodCodec : NSObject <FlutterMethodCodec>
-
A set of Flutter and Dart assets used by a
See moreFlutterEngine
to initialize execution.Declaration
Objective-C
@interface FlutterDartProject : NSObject
-
The FlutterEngine class coordinates a single instance of execution for a
FlutterDartProject
. It may have zero or oneFlutterViewController
at a time, which can be specified via-setViewController:
.FlutterViewController
‘sinitWithEngine
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 multipleFlutterViewController
instances to maintain state and/or asynchronous tasks (such as downloading a large file).A FlutterEngine can also be used to prewarm the Dart execution environment and reduce the latency of showing the Flutter screen when a
FlutterViewController
is created and presented. See http://flutter.dev/docs/development/add-to-app/performance for more details on loading performance.Alternatively, you can simply create a new
FlutterViewController
with only aFlutterDartProject
. ThatFlutterViewController
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
See more-runWithEntrypoint:
or-runWithEntrypoint:libraryURI
is invoked. One of these methods must be invoked before calling-setViewController:
.Declaration
Objective-C
@interface FlutterEngine : NSObject <FlutterTextureRegistry, FlutterPluginRegistry>
-
Deprecated
FlutterEngine should be used rather than FlutterHeadlessDartRunner
The deprecated FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer, and no native drawing surface. It is appropriate for use in running Dart code e.g. in the background from a plugin.
Most callers should prefer using
See moreFlutterEngine
directly; this interface exists for legacy support.Declaration
Objective-C
@interface FlutterHeadlessDartRunner : FlutterEngine
-
Propagates
See moreUIAppDelegate
callbacks to registered plugins.Declaration
Objective-C
@interface FlutterPluginAppLifeCycleDelegate : NSObject <UNUserNotificationCenterDelegate>
-
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 theFlutterEngine
attached FlutterViewController.A FlutterViewController can be initialized either with an already-running
FlutterEngine
via theinitWithEngine:
initializer, or it can be initialized with aFlutterDartProject
that will be used to implicitly spin up a newFlutterEngine
. Creating aFlutterEngine
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. See https://flutter.dev/docs/development/add-to-app/performance for more details on loading latency.Holding a
See moreFlutterEngine
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 otherUIViewController
s.Declaration
Objective-C
@interface FlutterViewController : UIViewController <FlutterTextureRegistry, FlutterPluginRegistry>