<commit_before>/// Copyright 2021 Google LLC.
/// SPDX-License-Identifier: Apache-2.0

part of '../pay.dart';

const supportedProviders = {
  TargetPlatform.android: ['google_pay'],
  TargetPlatform.iOS: ['apple_pay'],
};

class Pay {
  final PayPlatform _payPlatform;
  late final List<PaymentConfiguration> _configurations;
  late final _assetInitializationFuture;

  Pay(this._configurations) : _payPlatform = PayMethodChannel();

  Pay.withAssets(List<String> configAssets)
      : _payPlatform = PayMethodChannel() {
    _assetInitializationFuture = _loadConfigAssets(configAssets);
  }

  Future _loadConfigAssets(List<String> configurationAssets) async =>
      _configurations = await Future.wait(
          configurationAssets.map((ca) => PaymentConfiguration.fromAsset(ca)));
<commit_msg>Do not make the Future mandatory since it's only used during one of the instantiation paths<commit_after>/// Copyright 2021 Google LLC.
/// SPDX-License-Identifier: Apache-2.0

part of '../pay.dart';

const supportedProviders = {
  TargetPlatform.android: ['google_pay'],
  TargetPlatform.iOS: ['apple_pay'],
};

class Pay {
  final PayPlatform _payPlatform;
  late final List<PaymentConfiguration> _configurations;
  Future? _assetInitializationFuture;

  Pay(this._configurations) : _payPlatform = PayMethodChannel();

  Pay.withAssets(List<String> configAssets)
      : _payPlatform = PayMethodChannel() {
    _assetInitializationFuture = _loadConfigAssets(configAssets);
  }

  Future _loadConfigAssets(List<String> configurationAssets) async =>
      _configurations = await Future.wait(
          configurationAssets.map((ca) => PaymentConfiguration.fromAsset(ca)));

{'fraction_non_alphanumeric': 0.10891681627767803, 'fraction_numerical': 0.00718132854578097, 'mean_word_length': 4.950177935943061, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6677840', 'n_tokens_mistral': 487, 'n_tokens_neox': 469, 'n_words': 106}