getDeviceInfo method

Future<void> getDeviceInfo()

获取设备信息

Implementation

Future<void> getDeviceInfo() async {
  try {
    final deviceInfo = DeviceInfoPlugin();
    final res = (await deviceInfo.deviceInfo).data;
    res.remove('systemFeatures');
    res.remove('digitalProductId');
    if (res.containsKey('installDate')) {
      res.update('installDate', (v) => v.toString());
    }
    _deviceInfo = res;
  } catch (e, s) {
    debugPrint('获取设备信息, error: $e, stackTrace: $s');
  }
}