isAvailable property

  1. @override
Future<bool> isAvailable
override

Returns true when the API is available, which should be the case if the app is running on Android. The plugin will throw an exception when used on platforms where it's not available.

Implementation

@override
Future<bool> get isAvailable async {
  if (_checkedAvailability) {
    return _isAvailable;
  }

  var awailable = await methodChannel.invokeMethod("isSupported");
  _isAvailable = awailable;
  _checkedAvailability = true;

  return _isAvailable;
}