Kenneth Baldauf
Organizer & frequent presenter @ OC Android.
Senior Software Engineer @ Originate
// CLIENT CODE
static const platform = const MethodChannel('org.ocandroid.channel');
// invokeMethod returns Future
await platform.invokeMethod('someMethod');
// ANDROID CODE
MethodChannel(flutterView, "org.ocandroid.channel")
.setMethodCallHandler { call, result -> {
if (call.method == "someMethod") {
if (someCondition) {
result.success(someValue)
} else {
result.error("errCode", "errMessage", errDataObj)
}
} else {
result.notImplemented()
}
}
By Kenneth Baldauf
Flutter is Google's cross platform mobile application framework; let's take a look and see what all the hype is about.