GPayButtonStyle.fromJson constructor

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

Factory method to create a GPayButtonStyle from a JSON map.

Implementation

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