acceptsWarning method

Future<bool> acceptsWarning()

Implementation

Future<bool> acceptsWarning() async {
  final UserPreferences userPreferences = context.read<UserPreferences>();
  const String flagTag = UserPreferences.TAG_PRICE_PRIVACY_WARNING;
  final bool? already = userPreferences.getFlag(flagTag);
  if (already != true) {
    final bool? accepts = await doesAcceptWarning(justInfo: false);
    if (accepts != true) {
      return false;
    }
    await userPreferences.setFlag(flagTag, true);
  }
  return true;
}