youtube_explode/lib/src/videos/closed_captions/language.dart

31 lines
689 B
Dart
Raw Normal View History

2020-02-24 14:28:52 +01:00
import 'package:equatable/equatable.dart';
2020-11-13 09:21:01 +01:00
import 'package:json_annotation/json_annotation.dart';
part 'language.g.dart';
2020-02-24 14:28:52 +01:00
2020-02-23 20:29:08 +01:00
/// Language information.
2020-11-13 09:21:01 +01:00
@JsonSerializable()
2020-02-24 14:28:52 +01:00
class Language extends Equatable {
2020-02-23 20:29:08 +01:00
/// ISO 639-1 code of this language.
final String code;
/// Full English name of this language.
final String name;
/// Initializes an instance of [Language]
const Language(this.code, this.name);
2020-02-24 14:28:52 +01:00
@override
List<Object> get props => [code, name];
@override
String toString() => 'Language: $name';
2020-11-13 09:21:01 +01:00
///
factory Language.fromJson(Map<String, dynamic> json) =>
_$LanguageFromJson(json);
///
Map<String, dynamic> toJson() => _$LanguageToJson(this);
2020-02-23 20:29:08 +01:00
}