Type Definitions

The following type definitions are available globally.

  • A message reply callback.

    Used for submitting a binary reply back to a Flutter message sender. Also used in for handling a binary message reply received from Flutter.

    Declaration

    Objective-C

    typedef void (^FlutterBinaryReply)(NSData *_Nullable)

    Swift

    typealias FlutterBinaryReply = (Data?) -> Void

    Parameters

    reply

    The reply.

  • A strategy for handling incoming binary messages from Flutter and to send asynchronous replies back to Flutter.

    Declaration

    Objective-C

    typedef void (^FlutterBinaryMessageHandler)(NSData *_Nullable,
                                                FlutterBinaryReply _Nonnull)

    Swift

    typealias FlutterBinaryMessageHandler = (Data?, @escaping FlutterBinaryReply) -> Void

    Parameters

    message

    The message.

    reply

    A callback for submitting an asynchronous reply to the sender.

  • Undocumented

    Declaration

    Objective-C

    typedef int64_t FlutterBinaryMessengerConnection

    Swift

    typealias FlutterBinaryMessengerConnection = Int64
  • A message reply callback.

    Used for submitting a reply back to a Flutter message sender. Also used in the dual capacity for handling a message reply received from Flutter.

    Declaration

    Objective-C

    typedef void (^FlutterReply)(id _Nullable)

    Swift

    typealias FlutterReply = (Any?) -> Void

    Parameters

    reply

    The reply.

  • A strategy for handling incoming messages from Flutter and to send asynchronous replies back to Flutter.

    Declaration

    Objective-C

    typedef void (^FlutterMessageHandler)(id _Nullable, FlutterReply _Nonnull)

    Swift

    typealias FlutterMessageHandler = (Any?, @escaping FlutterReply) -> Void

    Parameters

    message

    The message.

    callback

    A callback for submitting a reply to the sender which can be invoked from any thread.

  • A method call result callback.

    Used for submitting a method call result back to a Flutter caller. Also used in the dual capacity for handling a method call result received from Flutter.

    Declaration

    Objective-C

    typedef void (^FlutterResult)(id _Nullable)

    Swift

    typealias FlutterResult = (Any?) -> Void

    Parameters

    result

    The result.

  • A strategy for handling method calls.

    Declaration

    Objective-C

    typedef void (^FlutterMethodCallHandler)(FlutterMethodCall *_Nonnull,
                                             FlutterResult _Nonnull)

    Swift

    typealias FlutterMethodCallHandler = (FlutterMethodCall, @escaping FlutterResult) -> Void

    Parameters

    call

    The incoming method call.

    result

    A callback to asynchronously submit the result of the call. Invoke the callback with a FlutterError to indicate that the call failed. Invoke the callback with FlutterMethodNotImplemented to indicate that the method was unknown. Any other values, including nil, are interpreted as successful results. This can be invoked from any thread.

  • An event sink callback.

    Declaration

    Objective-C

    typedef void (^FlutterEventSink)(id _Nullable)

    Swift

    typealias FlutterEventSink = (Any?) -> Void

    Parameters

    event

    The event.

  • A callback for when FlutterHeadlessDartRunner has attempted to start a Dart Isolate in the background.

    Declaration

    Objective-C

    typedef void (^FlutterHeadlessDartRunnerCallback)(BOOL)

    Swift

    typealias FlutterHeadlessDartRunnerCallback = (Bool) -> Void

    Parameters

    success

    YES if the Isolate was started and run successfully, NO otherwise.

  • A plugin registration callback.

    Used for registering plugins with additional instances of FlutterPluginRegistry.

    Declaration

    Objective-C

    typedef void (*FlutterPluginRegistrantCallback)(
        NSObject<FlutterPluginRegistry> *_Nonnull)

    Swift

    typealias FlutterPluginRegistrantCallback = (FlutterPluginRegistry) -> Void

    Parameters

    registry

    The registry to register plugins with.

  • How the UIGestureRecognizers of a platform view are blocked.

    UIGestureRecognizers of platform views can be blocked based on decisions made by the Flutter Framework (e.g. When an interact-able widget is covering the platform view).

    See more

    Declaration

    Objective-C

    typedef enum FlutterPlatformViewGestureRecognizersBlockingPolicy
        FlutterPlatformViewGestureRecognizersBlockingPolicy