30 lines
559 B
Dart
30 lines
559 B
Dart
class Language {
|
|
final String code;
|
|
final String name;
|
|
final String nativeName;
|
|
final String iconFile;
|
|
|
|
Language({
|
|
required this.code,
|
|
required this.name,
|
|
required this.nativeName,
|
|
required this.iconFile,
|
|
});
|
|
|
|
// convert to a map
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'code': code,
|
|
'name': name,
|
|
'nativeName': nativeName,
|
|
'iconFile': iconFile,
|
|
};
|
|
}
|
|
|
|
@override
|
|
int get hashCode => code.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) => other is Language && code == other.code;
|
|
}
|