Line data Source code
1 : ///Possible text track window types.
2 : enum TextTrackWindowType {
3 : /// No window background.
4 : none,
5 :
6 : /// Normal rectangular window.
7 : normal,
8 :
9 : /// Window with rounded corners.
10 : roundedCorners;
11 :
12 0 : factory TextTrackWindowType.fromMap(String value) {
13 : // Try matching by name (lowerCamelCase)
14 0 : for (final v in values) {
15 0 : if (v.name == value) return v;
16 : }
17 : // Fallback: match legacy UPPER_SNAKE_CASE
18 : switch (value) {
19 0 : case 'NONE':
20 : return TextTrackWindowType.none;
21 0 : case 'NORMAL':
22 : return TextTrackWindowType.normal;
23 0 : case 'ROUNDED_CORNERS':
24 : return TextTrackWindowType.roundedCorners;
25 : default:
26 0 : throw ArgumentError('Unknown TextTrackWindowType: $value');
27 : }
28 : }
29 : }
|