Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby
617 B
Raw Blame
class SsoProvider {
  final String name;
  final String strategy;
  final String label;

  const SsoProvider({
    required this.name,
    required this.strategy,
    required this.label,
  });

  /// Google keeps its brand-compliant "Sign in with Google" button.
  bool get isGoogle => strategy == 'google_oauth2';

  factory SsoProvider.fromJson(Map<String, dynamic> json) {
    final name = json['name'] as String;
    final label = json['label'] as String? ?? '';
    return SsoProvider(
      name: name,
      strategy: json['strategy'] as String? ?? '',
      label: label.isEmpty ? name : label,
    );
  }
}