getLastReturnCode method Null safety

Future<int?> getLastReturnCode()

Returns return code of the last executed command.

Implementation

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