Skip to content

Commit 2a44ac0

Browse files
committed
Amended section Custom Decoders.
1 parent 7d9b426 commit 2a44ac0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ process.
6060

6161
The extension [`Reader`][Reader] provides a systematic method of
6262
retrieving constants of
63-
arbitrary data-types by allowing users to register `Decoder` objects.
63+
arbitrary data-types by allowing users to register [`Decoder`][Decoder] objects.
64+
To create custom decoder extend [`Decoder<T>`][Decoder] and override the
65+
the method `T read<T>(DartObject obj)`. This method
66+
attempts to read a variable of type `T` from the compile-time constant
67+
`obj` and returns the result.
6468

65-
`Decoder<T>` is an abstract
66-
parameterized class with a method `T read<T>(DartObject obj)`
67-
that attempt to read a variable of type `T` from `obj` and return the result.
6869
The example below demonstrates how to create a custom decoder for the
6970
sample class `Annotation` and register an instance of the decoder with
7071
the extension [`Reader`][Reader].

0 commit comments

Comments
 (0)