get method

Implementation

Future<DesignFlowDeviceInfo> get() async {
  final deviceInfoResponse = DeviceInfoPlugin();
  final packageInfo = await PackageInfo.fromPlatform();

  final osName = await _osName(deviceInfoResponse);
  final osVersion = await _osVersion();

  final List<Locale> systemLocales = [];
  try {
    systemLocales.addAll(WidgetsBinding.instance.platformDispatcher.locales);
  } catch (e) {
    Logger.printError(e.toString());
  }

  return DesignFlowDeviceInfo(
    osName,
    osVersion ?? '',
    systemLocales.isNotEmpty ? systemLocales.first.toString() : null,
    packageInfo.buildNumber,
    packageInfo.version,
  );
}