mirror of
https://github.com/hackku21/nearby_connections.git
synced 2026-03-02 03:49:22 +00:00
remove boilerplate
This commit is contained in:
@@ -6,20 +6,26 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
|
||||
import io.flutter.plugin.common.MethodChannel.Result;
|
||||
import io.flutter.plugin.common.PluginRegistry.Registrar;
|
||||
|
||||
/** NearbyConnectionsPlugin */
|
||||
/**
|
||||
* NearbyConnectionsPlugin
|
||||
*/
|
||||
public class NearbyConnectionsPlugin implements MethodCallHandler {
|
||||
/** Plugin registration. */
|
||||
public static void registerWith(Registrar registrar) {
|
||||
final MethodChannel channel = new MethodChannel(registrar.messenger(), "nearby_connections");
|
||||
channel.setMethodCallHandler(new NearbyConnectionsPlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMethodCall(MethodCall call, Result result) {
|
||||
if (call.method.equals("getPlatformVersion")) {
|
||||
result.success("Android " + android.os.Build.VERSION.RELEASE);
|
||||
} else {
|
||||
result.notImplemented();
|
||||
/**
|
||||
* Plugin registration.
|
||||
*/
|
||||
public static void registerWith(Registrar registrar) {
|
||||
final MethodChannel channel = new MethodChannel(registrar.messenger(), "nearby_connections");
|
||||
channel.setMethodCallHandler(new NearbyConnectionsPlugin());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMethodCall(MethodCall call, Result result) {
|
||||
|
||||
switch (call.method) {
|
||||
|
||||
default:
|
||||
result.notImplemented();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user