initPlatformState method

Future<String> initPlatformState()

Implementation

Future<String> initPlatformState() async {
  // Platform messages may fail, so we use a try/catch PlatformException.
  try {
    StringUtils.deviceId = (await PlatformDeviceId.getDeviceId)!;
  } on PlatformException {
    StringUtils.deviceId = 'Unknown';
  }

  return StringUtils.deviceId;
  // If the widget was removed from the tree while the asynchronous platform
  // message was in flight, we want to discard the reply rather than calling
  // setState to update our non-existent appearance.
}