File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
json_serializable/lib/src Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class JsonValue {
1212 /// Optional values that can be used when deserializing.
1313 ///
1414 /// The elements of [aliases] must be either [String] or [int] .
15- final List <Object ?> aliases;
15+ final Set <Object ?> aliases;
1616
17- const JsonValue (this .value, {this .aliases = const [] });
17+ const JsonValue (this .value, {this .aliases = const {} });
1818}
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ Map<Object?, FieldElement>? _enumAliases(
121121 jsonEnum: jsonEnum,
122122 targetType: targetType,
123123 ): field,
124- for (final alias in _generateAlias (field: field, targetType: targetType))
124+ for (final alias in _generateAliases (field: field, targetType: targetType))
125125 alias: field,
126126 },
127127 };
@@ -192,7 +192,7 @@ Object? _generateEntry({
192192 }
193193}
194194
195- List <Object ?> _generateAlias ({
195+ List <Object ?> _generateAliases ({
196196 required FieldElement field,
197197 required DartType targetType,
198198}) {
@@ -208,7 +208,7 @@ List<Object?> _generateAlias({
208208
209209 if (valueReader.validAliasesType) {
210210 return [
211- for (final value in valueReader.listValue )
211+ for (final value in valueReader.setValue )
212212 ConstantReader (value).literalValue,
213213 ];
214214 } else {
You can’t perform that action at this time.
0 commit comments