Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package io.flutter.plugin.common;

import android.support.annotation.Nullable;
import java.util.Map;
import org.json.JSONObject;

Expand Down Expand Up @@ -61,6 +62,7 @@ public <T> T arguments() {
* {@link JSONObject}.
*/
@SuppressWarnings("unchecked")
@Nullable
public <T> T argument(String key) {
if (arguments == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package io.flutter.plugin.common;

import android.support.annotation.Nullable;
import android.util.Log;
import io.flutter.plugin.common.BinaryMessenger.BinaryMessageHandler;
import io.flutter.plugin.common.BinaryMessenger.BinaryReply;
Expand Down Expand Up @@ -65,7 +66,7 @@ public MethodChannel(BinaryMessenger messenger, String name, MethodCodec codec)
* @param method the name String of the method.
* @param arguments the arguments for the invocation, possibly null.
*/
public void invokeMethod(String method, Object arguments) {
public void invokeMethod(String method, @Nullable Object arguments) {
invokeMethod(method, arguments, null);
}

Expand All @@ -78,7 +79,7 @@ public void invokeMethod(String method, Object arguments) {
* @param arguments the arguments for the invocation, possibly null.
* @param callback a {@link Result} callback for the invocation result, or null.
*/
public void invokeMethod(String method, Object arguments, Result callback) {
public void invokeMethod(String method, @Nullable Object arguments, Result callback) {
messenger.send(name, codec.encodeMethodCall(new MethodCall(method, arguments)),
callback == null ? null : new IncomingResultHandler(callback));
}
Expand All @@ -97,7 +98,7 @@ public void invokeMethod(String method, Object arguments, Result callback) {
*
* @param handler a {@link MethodCallHandler}, or null to deregister.
*/
public void setMethodCallHandler(final MethodCallHandler handler) {
public void setMethodCallHandler(final @Nullable MethodCallHandler handler) {
messenger.setMessageHandler(name,
handler == null ? null : new IncomingMethodCallHandler(handler));
}
Expand Down Expand Up @@ -143,7 +144,7 @@ public interface Result {
*
* @param result The result, possibly null.
*/
void success(Object result);
void success(@Nullable Object result);

/**
* Handles an error result.
Expand All @@ -152,7 +153,7 @@ public interface Result {
* @param errorMessage A human-readable error message String, possibly null.
* @param errorDetails Error details, possibly null
*/
void error(String errorCode, String errorMessage, Object errorDetails);
void error(String errorCode, @Nullable String errorMessage, @Nullable Object errorDetails);

/**
* Handles a call to an unimplemented method.
Expand Down