Package io.flutter.plugin.common
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 must be called on the platform thread (Android main thread). For more details see Threading in the Flutter Engine.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
error(String errorCode, String errorMessage, Object errorDetails)
Handles an error result.void
notImplemented()
Handles a call to an unimplemented method.void
success(Object result)
Handles a successful result.
-
-
-
Method Detail
-
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 usingStandardMessageCodec
(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 usingStandardMessageCodec
(default), please see its documentation on what types are supported.
-
notImplemented
void notImplemented()
Handles a call to an unimplemented method.
-
-