remove boilerplate

This commit is contained in:
Prerak Mann
2019-05-10 13:03:41 +05:30
parent 7f1c9c9e8c
commit 59cb4ba91d
7 changed files with 38 additions and 59 deletions

View File

@@ -31,4 +31,7 @@ android {
lintOptions {
disable 'InvalidPackage'
}
dependencies{
api 'com.google.android.gms:play-services-nearby:16.0.0'
}
}

View File

@@ -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();
}
}
}
}