@@ -28,7 +28,8 @@ To use the package [`generic_reader`][generic_reader] the following steps are re
2828your pubspec.yaml file.
2929
30302 . Register a [ Decoder] [ Decoder ] object for each * user defined*
31- data-type ` T ` that is going to be read. <br />
31+ data-type ` U ` that is going to be read
32+ (see section [ Custom Decoders] ( #custom-decoders ) ). </br >
3233Note: The following type are supported out-of-the-box and do * not* require a decoder:
3334* ` bool ` , ` double ` , ` int ` , ` num ` ,` String ` , ` Type ` , ` Symbol ` ,
3435* ` List<bool> ` , ` List<double> ` , ` List<int> ` , ` List<num> ` ,
@@ -41,13 +42,11 @@ Note: The following type are supported out-of-the-box and do *not* require a dec
41423 . Use Dart's static [ ` analyzer ` ] [ analyzer ] to read a library, get
4243the relevant [ ` VariableElement ` ] [ VariableElement ] , and calculate the constant
4344expression represented by a [ ` DartObject ` ] [ DartObject ]
44- using the method [ ` computeConstantValue() ` ] [ computeConstantValue() ] .
45+ using the method [ ` computeConstantValue() ` ] [ computeConstantValue() ] . An exmple
46+ is shown in section [ Reading an Enumeration] ( #reading-an-enumeration ) .
4547
46484 . Read the compile-time constant values using the extension method: [ ` read<T> ` ] [ read ] . <br />
4749
48- To read a constant of a user-defined type ` U ` , add a suitable ` Decoder<U `
49- (see section [ Custom Decoders] ( #custom-decoders ) );
50-
5150 To read a constant representing a * collection* of a * user-defined* type ` U `
5251 use the convenience methods [ ` readList<U> ` ] [ readList ] ,
5352 [ ` readSet<U> ` ] [ readSet ] , [ ` readMap<K,U> ` ] [ readMap ] , and [ ` readIterator<U> ` ] [ readIterator ] .
@@ -232,10 +231,11 @@ listObj.readList<List<String>>(): [[a], [b]]
232231
2332321 ) When using the type ` dynamic ` the static type of the [ DartObject] [ DartObject ]
234233is used to determine the correct type of the runtime object. If a suitable
235- decoder is registered with the [ Reader] [ Reader ] on can omit the type parameter
236- when using e.g. [ ` read ` ] [ read ] . For example, the variable ` list2 ` in section
237- [ Reading a Nested List] ( #reading-a-nested-list ) is calculated using
238- [ read] [ read ] .
234+ decoder is registered with the [ Reader] [ Reader ] it is possible
235+ (but not recommended) to omit the type parameter.
236+ For example, the variable ` list2 ` in section
237+ [ Reading a Nested List] ( #reading-a-nested-list ) is calculated using the extension
238+ method [ read] [ read ] without specifying the type parameter.
239239
2402402 ) Defining decoder functions for each data-type has its obvious limitiations when it comes to * generic types* .
241241In practice, however, generic classes are often designed in such a manner
0 commit comments