FlutterError

Objective-C

@interface FlutterError : NSObject

Swift

class FlutterError : NSObject

Error object representing an unsuccessful outcome of invoking a method on a FlutterMethodChannel, or an error event on a FlutterEventChannel.

  • Creates a FlutterError with the specified error code, message, and details.

    Declaration

    Objective-C

    + (nonnull instancetype)errorWithCode:(nonnull NSString *)code
                                  message:(NSString *_Nullable)message
                                  details:(id _Nullable)details;

    Swift

    convenience init(code: String, message: String?, details: Any?)

    Parameters

    code

    An error code string for programmatic use.

    message

    A human-readable error message.

    details

    Custom error details.

  • The error code.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull code;

    Swift

    var code: String { get }
  • The error message.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *message;

    Swift

    var message: String? { get }
  • The error details.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) id details;

    Swift

    var details: Any? { get }