getPlatform method

Future<String?> getPlatform()

Returns platform name in which library is loaded.

Implementation

Future<String?> getPlatform() async {
  try {
    var result = await _methodChannel.invokeMethod('getPlatform');
    return result['platform'];
  } on PlatformException catch (e, stack) {
    logger.e('Plugin getPlatform error: ${e.message}');
    return Future.error('getPlatform failed.', stack);
  }
}