Skip to content

Commit 52094b2

Browse files
committed
add comment
1 parent c45e5ff commit 52094b2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkgs/json_syntax_generator/lib/src/parser/schema_analyzer.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ class SchemaAnalyzer {
4545
final List<String> publicSetters;
4646

4747
/// For subtypes of these classes, the union tag values are exposed.
48+
///
49+
/// For example, if `Asset.type` is `NativeCodeAsset.typeValue`, then the
50+
/// asset is a native code asset. Listing `Asset` in [visbleUnionTagValues]
51+
/// will add `static const typeValue = 'native_code';`:
52+
///
53+
/// ```dart
54+
/// class NativeCodeAsset extends Asset {
55+
/// static const typeValue = 'native_code';
56+
/// }
57+
///
58+
/// class Asset {
59+
/// String? get type => _reader.get<String?>('type');
60+
/// }
61+
/// ```
4862
final List<String> visbleUnionTagValues;
4963

5064
SchemaAnalyzer(

0 commit comments

Comments
 (0)