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