11// automatically generated by the FlatBuffers compiler, do not modify
2- // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable
2+ // ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable, constant_identifier_names
33
44library keyword_test;
55
66import 'dart:typed_data' show Uint8List;
77import 'package:flat_buffers/flat_buffers.dart' as fb;
88
99
10- class Abc {
10+ enum Abc {
11+ $void (0 ),
12+ where (1 ),
13+ stackalloc (2 );
14+
1115 final int value;
12- const Abc ._ (this .value);
16+ const Abc (this .value);
1317
1418 factory Abc .fromValue (int value) {
15- final result = values[value];
16- if (result == null ) {
17- throw StateError ('Invalid value $value for bit flag enum Abc' );
19+ switch (value) {
20+ case 0 : return Abc .$void;
21+ case 1 : return Abc .where;
22+ case 2 : return Abc .stackalloc;
23+ default : throw StateError ('Invalid value $value for bit flag enum' );
1824 }
19- return result;
2025 }
2126
22- static Abc ? _createOrNull (int ? value) =>
27+ static Abc ? _createOrNull (int ? value) =>
2328 value == null ? null : Abc .fromValue (value);
2429
2530 static const int minValue = 0 ;
2631 static const int maxValue = 2 ;
27- static bool containsValue (int value) => values.containsKey (value);
28-
29- static const Abc $void = Abc ._(0 );
30- static const Abc where = Abc ._(1 );
31- static const Abc stackalloc = Abc ._(2 );
32- static const Map <int , Abc > values = {
33- 0 : $void,
34- 1 : where,
35- 2 : stackalloc};
36-
3732 static const fb.Reader <Abc > reader = _AbcReader ();
38-
39- @override
40- String toString () {
41- return 'Abc{value: $value }' ;
42- }
4333}
4434
4535class _AbcReader extends fb.Reader <Abc > {
@@ -53,35 +43,25 @@ class _AbcReader extends fb.Reader<Abc> {
5343 Abc .fromValue (const fb.Int32Reader ().read (bc, offset));
5444}
5545
56- class Public {
46+ enum Public {
47+ NONE (0 );
48+
5749 final int value;
58- const Public ._ (this .value);
50+ const Public (this .value);
5951
6052 factory Public .fromValue (int value) {
61- final result = values[ value];
62- if (result == null ) {
63- throw StateError ('Invalid value $value for bit flag enum Public ' );
53+ switch ( value) {
54+ case 0 : return Public . NONE ;
55+ default : throw StateError ('Invalid value $value for bit flag enum' );
6456 }
65- return result;
6657 }
6758
68- static Public ? _createOrNull (int ? value) =>
59+ static Public ? _createOrNull (int ? value) =>
6960 value == null ? null : Public .fromValue (value);
7061
7162 static const int minValue = 0 ;
7263 static const int maxValue = 0 ;
73- static bool containsValue (int value) => values.containsKey (value);
74-
75- static const Public NONE = Public ._(0 );
76- static const Map <int , Public > values = {
77- 0 : NONE };
78-
7964 static const fb.Reader <Public > reader = _PublicReader ();
80-
81- @override
82- String toString () {
83- return 'Public{value: $value }' ;
84- }
8565}
8666
8767class _PublicReader extends fb.Reader <Public > {
@@ -95,39 +75,29 @@ class _PublicReader extends fb.Reader<Public> {
9575 Public .fromValue (const fb.Int32Reader ().read (bc, offset));
9676}
9777
98- class KeywordsInUnionTypeId {
78+ enum KeywordsInUnionTypeId {
79+ NONE (0 ),
80+ $static (1 ),
81+ internal (2 );
82+
9983 final int value;
100- const KeywordsInUnionTypeId ._ (this .value);
84+ const KeywordsInUnionTypeId (this .value);
10185
10286 factory KeywordsInUnionTypeId .fromValue (int value) {
103- final result = values[value];
104- if (result == null ) {
105- throw StateError ('Invalid value $value for bit flag enum KeywordsInUnionTypeId' );
87+ switch (value) {
88+ case 0 : return KeywordsInUnionTypeId .NONE ;
89+ case 1 : return KeywordsInUnionTypeId .$static;
90+ case 2 : return KeywordsInUnionTypeId .internal;
91+ default : throw StateError ('Invalid value $value for bit flag enum' );
10692 }
107- return result;
10893 }
10994
110- static KeywordsInUnionTypeId ? _createOrNull (int ? value) =>
95+ static KeywordsInUnionTypeId ? _createOrNull (int ? value) =>
11196 value == null ? null : KeywordsInUnionTypeId .fromValue (value);
11297
11398 static const int minValue = 0 ;
11499 static const int maxValue = 2 ;
115- static bool containsValue (int value) => values.containsKey (value);
116-
117- static const KeywordsInUnionTypeId NONE = KeywordsInUnionTypeId ._(0 );
118- static const KeywordsInUnionTypeId $static = KeywordsInUnionTypeId ._(1 );
119- static const KeywordsInUnionTypeId internal = KeywordsInUnionTypeId ._(2 );
120- static const Map <int , KeywordsInUnionTypeId > values = {
121- 0 : NONE ,
122- 1 : $static,
123- 2 : internal};
124-
125100 static const fb.Reader <KeywordsInUnionTypeId > reader = _KeywordsInUnionTypeIdReader ();
126-
127- @override
128- String toString () {
129- return 'KeywordsInUnionTypeId{value: $value }' ;
130- }
131101}
132102
133103class _KeywordsInUnionTypeIdReader extends fb.Reader <KeywordsInUnionTypeId > {
0 commit comments