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

28 lines
629 B
Dart
Raw Normal View History

2021-07-21 02:06:02 +02:00
import 'package:freezed_annotation/freezed_annotation.dart';
2020-11-13 09:21:01 +01:00
import 'package:json_annotation/json_annotation.dart';
part 'language.g.dart';
2021-07-21 02:06:02 +02:00
part 'language.freezed.dart';
2020-02-24 14:28:52 +01:00
2020-02-23 20:29:08 +01:00
/// Language information.
2021-07-21 02:06:02 +02:00
@freezed
class Language with _$Language {
/// Initializes an instance of [Language]
const factory Language(
2020-02-23 20:29:08 +01:00
2021-07-21 02:06:02 +02:00
/// ISO 639-1 code of this language.
String code,
2020-02-23 20:29:08 +01:00
2021-07-21 02:06:02 +02:00
/// Full English name of this language.
String name) = _Language;
2020-02-24 14:28:52 +01:00
2021-07-21 02:06:02 +02:00
const Language._();
@override
String toString() => 'Language: $name';
2020-11-13 09:21:01 +01:00
///
factory Language.fromJson(Map<String, dynamic> json) =>
_$LanguageFromJson(json);
2020-02-23 20:29:08 +01:00
}