readDeviceRecord method

  1. @override
Future<List<DeviceRecord>?> readDeviceRecord()
override

Implementation

@override
Future<List<DeviceRecord>?> readDeviceRecord() {
  return _channel.invokeMethod<String>("readDeviceRecord").then((value) {
    if (value == null || value == "null") {
      return null;
    }
    List<DeviceRecord> deviceRecordList = [];
    List<dynamic> list = json.decode(value);
    for (int i = 0; i < list.length; i++) {
      deviceRecordList.add(DeviceRecord.fromJson(list[i]));
    }
    return deviceRecordList;
  });
}