<commit_before>part of '../../pay_mobile.dart';

enum GooglePayButtonType { pay, checkout, donate }
enum GooglePayButtonColor { black, white, flat }

extension GooglePayButtonTypeAsset on GooglePayButtonType {
  static const _defaultAsset = 'gpay_logo';
  static const _defaultAssetWidth = 54.0;

  String get asset =>
      {
        GooglePayButtonType.pay: 'buy_with_gpay',
        GooglePayButtonType.checkout: _defaultAsset,
        GooglePayButtonType.donate: 'donate_with_gpay',
      }[this] ??
      _defaultAsset;

  double get assetWidth =>
      {
        GooglePayButtonType.pay: 135.0,
        GooglePayButtonType.checkout: _defaultAssetWidth,
        GooglePayButtonType.donate: 167.0,
      }[this] ??
      _defaultAssetWidth;
}

extension GooglePayButtonColorAsset on GooglePayButtonColor {
  static const _defaultAssetSuffix = '_dark';

  String get assetSuffix =>
      {
        GooglePayButtonColor.black: _defaultAssetSuffix,
        GooglePayButtonColor.white: '_clear',
        GooglePayButtonColor.flat: '_clear',
      }[this] ??
      _defaultAssetSuffix;
}

class RawGooglePayButton extends StatelessWidget {
  static const double _height = 43;
  static const double _minHorizontalPadding = 30;

  final GestureTapCallback onPressed;
  final GooglePayButtonType type;
  final GooglePayButtonColor color;

  const RawGooglePayButton({
    Key? key,
    required this.onPressed,
    this.type = GooglePayButtonType.pay,
    this.color = GooglePayButtonColor.black,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final Widget rawButton = RawMaterialButton(<commit_msg>Remove the extension name for privacy reasons<commit_after>part of '../../pay_mobile.dart';

enum GooglePayButtonType { pay, checkout, donate }
enum GooglePayButtonColor { black, white, flat }

extension on GooglePayButtonType {
  static const _defaultAsset = 'gpay_logo';
  static const _defaultAssetWidth = 54.0;

  String get asset =>
      {
        GooglePayButtonType.pay: 'buy_with_gpay',
        GooglePayButtonType.checkout: _defaultAsset,
        GooglePayButtonType.donate: 'donate_with_gpay',
      }[this] ??
      _defaultAsset;

  double get assetWidth =>
      {
        GooglePayButtonType.pay: 135.0,
        GooglePayButtonType.checkout: _defaultAssetWidth,
        GooglePayButtonType.donate: 167.0,
      }[this] ??
      _defaultAssetWidth;
}

extension on GooglePayButtonColor {
  static const _defaultAssetSuffix = '_dark';

  String get assetSuffix =>
      {
        GooglePayButtonColor.black: _defaultAssetSuffix,
        GooglePayButtonColor.white: '_clear',
        GooglePayButtonColor.flat: '_clear',
      }[this] ??
      _defaultAssetSuffix;
}

class RawGooglePayButton extends StatelessWidget {
  static const double _height = 43;
  static const double _minHorizontalPadding = 30;

  final GestureTapCallback onPressed;
  final GooglePayButtonType type;
  final GooglePayButtonColor color;

  const RawGooglePayButton({
    Key? key,
    required this.onPressed,
    this.type = GooglePayButtonType.pay,
    this.color = GooglePayButtonColor.black,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final Widget rawButton = RawMaterialButton(
{'fraction_non_alphanumeric': 0.08346213292117466, 'fraction_numerical': 0.00927357032457496, 'mean_word_length': 3.6294706723891275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2006465', 'n_tokens_mistral': 975, 'n_tokens_neox': 929, 'n_words': 221}