getReturnCode method

Future<ReturnCode?> getReturnCode()
override

Returns the return code for this session. Note that return code is only set for sessions that end with COMPLETED state. If a session is not started, still running or failed then this method returns null.

Implementation

Future<ReturnCode?> getReturnCode() async {
  try {
    return _platform
        .abstractSessionGetReturnCode(this.getSessionId())
        .then((returnCode) {
      if (returnCode == null) {
        return null;
      } else {
        return new ReturnCode(returnCode);
      }
    });
  } on PlatformException catch (e, stack) {
    print("Plugin getReturnCode error: ${e.message}");
    return Future.error("getReturnCode failed.", stack);
  }
}