Interface MethodChannel.Result

All Known Implementing Classes:
ErrorLogResult
Enclosing class:
MethodChannel

public static interface MethodChannel.Result
Method call result callback. Supports dual use: Implementations of methods to be invoked by Flutter act as clients of this interface for sending results back to Flutter. Invokers of Flutter methods provide implementations of this interface for handling results received from Flutter.

All methods of this class can be invoked on any thread.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(String errorCode, String errorMessage, Object errorDetails)
    Handles an error result.
    void
    Handles a call to an unimplemented method.
    void
    success(Object result)
    Handles a successful result.
  • Method Details

    • success

      void success(@Nullable Object result)
      Handles a successful result.
      Parameters:
      result - The result, possibly null. The result must be an Object type supported by the codec. For instance, if you are using StandardMessageCodec (default), please see its documentation on what types are supported.
    • error

      void error(@NonNull String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails)
      Handles an error result.
      Parameters:
      errorCode - An error code String.
      errorMessage - A human-readable error message String, possibly null.
      errorDetails - Error details, possibly null. The details must be an Object type supported by the codec. For instance, if you are using StandardMessageCodec (default), please see its documentation on what types are supported.
    • notImplemented

      void notImplemented()
      Handles a call to an unimplemented method.