ApplePayButtonStyle.fromJson constructor

ApplePayButtonStyle.fromJson(
  1. Map<String, dynamic> json
)

Factory method to create an ApplePayButtonStyle from a JSON map.

Implementation

factory ApplePayButtonStyle.fromJson(Map<String, dynamic> json) {
  return ApplePayButtonStyle(
    light: ApplePayButtonStyleType.values
        .firstWhere((e) => e.name == json['light']),
    dark: ApplePayButtonStyleType.values
        .firstWhere((e) => e.name == json['dark']),
  );
}