preludeAfterAgreed static method

Future<void> preludeAfterAgreed()

Initialization.

According to privacy policy, you should call this after agreement is accepted.

Implementation

static Future<void> preludeAfterAgreed() async {
  if (_device != null) {
    BadFl.log(
      module: 'impl/AppMetaImpl',
      message:
          'The call to "preludeAfterAgreed" is ignored cause device info has already been initialized',
    );
    return;
  }

  final deviceInfo = DeviceInfoPlugin();
  if (Platform.isAndroid) {
    final info = await deviceInfo.androidInfo;
    _device = '${info.brand}/${info.display}';
  } else if (Platform.isIOS) {
    final info = await deviceInfo.iosInfo;
    _device = '${info.utsname.machine}/${info.systemVersion}';
  } else {
    throw UnsupportedError('Unsupported platform: $os');
  }

  BadFl.log(module: 'impl/AppMetaImpl', message: 'Device info initialized');
}