latestDeviceResult property

Future<Map<String, dynamic>?> get latestDeviceResult

Implementation

static Future<Map<String, dynamic>?> get latestDeviceResult async {
  try {
    final result = await _channel.invokeMethod('getDeviceResult');
    latestError = null;

    if (result == null) return null;

    return json.decode(result);
  } on PlatformException catch (e) {
    latestError =
        ShieldError(int.tryParse(e.code) ?? 0, e.message ?? "Unknown error");
  } catch (e, s) {
    _internalLog("latestDeviceResult failed", e, s);
    latestError = ShieldError(0, "Unknown error ${e.toString()}");
  }
  return null;
}