@@ -258,14 +258,14 @@ customize the encoding/decoding of any type, you have a few options.
258
258
259
259
# Sealed classes
260
260
261
- As of [ `json_serializable`] version 6.10.0 and [ `json_annotation`]
261
+ As of `json_serializable` version 6.10.0 and `json_annotation`
262
262
version 4.10.0, sealed classes can be serialized to json unions and json unions
263
263
can be deserialized to sealed classes.
264
264
265
265
To achieve this, both the sealed class and its subclasses should be annotated
266
- with `JsonSerializable`. Only the sealed class should have `fromJson` factory
267
- and `toJson` functions . To customize the sealed class behavior, use the fields
268
- `unionRename` and `unionDiscriminator` in `JsonSerializable` or adjust the
266
+ with [ `JsonSerializable`] . Only the sealed class should have `fromJson` factory
267
+ or `toJson` function . To customize the sealed class behavior, use the fields
268
+ `unionRename` and `unionDiscriminator` in [ `JsonSerializable`] or adjust the
269
269
default behavior by changing the corresponding fields in `build.yaml`. For
270
270
more complex examples, please see [example]:
271
271
@@ -359,8 +359,6 @@ targets:
359
359
[`Enum`] : https://api.dart.dev/dart-core/Enum-class.html
360
360
[`int`] : https://api.dart.dev/dart-core/int-class.html
361
361
[`Iterable`] : https://api.dart.dev/dart-core/Iterable-class.html
362
- [`json_annotation`] : https://unknown.com/package/json_annotation
363
- [`json_serializable`] : https://unknown.com/package/json_serializable
364
362
[`JsonConverter`] : https://pub.dev/documentation/json_annotation/4.10.0/json_annotation/JsonConverter-class.html
365
363
[`JsonEnum.valueField`] : https://pub.dev/documentation/json_annotation/4.10.0/json_annotation/JsonEnum/valueField.html
366
364
[`JsonEnum`] : https://pub.dev/documentation/json_annotation/4.10.0/json_annotation/JsonEnum-class.html
0 commit comments