I came across these code in flutter.
static Future<String> get platformVersion async
{
final String version = await _channel.invokeMethod('getPlatformVersion');
return version;
}
I was creating flutter plugin using android studio. Do we have to use await keyword while accessing its value
Yes, because the return type is a Future, you await
the value. You would do :
String platformVersion = await GetVersion.platformVersion;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With