class Language { final String code; final String name; final List targets; const Language({ required this.code, required this.name, this.targets = const [], }); factory Language.fromJson(Map json) { return Language( code: json['code'] as String, name: json['name'] as String, targets: (json['targets'] as List?)?.map((e) => e.toString()).toList() ?? const [], ); } /// "Otomatik Algıla" seçeneğini temsil eden özel dil. static const auto = Language(code: 'auto', name: 'Otomatik Algıla'); @override bool operator ==(Object other) => other is Language && other.code == code; @override int get hashCode => code.hashCode; }