22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5- import 'dart:core' ;
6-
75import 'package:analyzer/dart/element/element.dart' ;
86import 'package:analyzer/dart/element/nullability_suffix.dart' ;
97import 'package:build/build.dart' ;
@@ -79,22 +77,18 @@ mixin DecodeHelper implements HelperCore {
7977 /// If [functionBodyParts] has only one element, expression body is used.
8078 ///
8179 /// ```dart
82- /// '''
8380 /// ExampleClass _$ExampleClassFromJson(Map<String, dynamic> json) =>
8481 /// /* only body part here */
85- /// '''
8682 /// ```
8783 ///
8884 /// If [functionBodyParts] has more than one element, block body is used.
8985 ///
9086 /// ```dart
91- /// '''
9287 /// ExampleClass _$ExampleClassFromJson(Map<String, dynamic> json) {
9388 /// /* first body parts here */
9489 ///
9590 /// return /* last body part here */;
9691 /// }
97- /// '''
9892 /// ```
9993 String _createFromJsonFunctionSignature (Iterable <String > functionBodyParts) {
10094 final mapType = config.anyMap ? 'Map' : 'Map<String, dynamic>' ;
@@ -138,13 +132,11 @@ mixin DecodeHelper implements HelperCore {
138132 ///
139133 /// For example:
140134 /// ```dart
141- /// '''
142135 /// switch (json['type']) {
143136 /// 'FirstSubtype' => _$FirstSubtypeFromJson(json),
144137 /// 'SecondSubtype' => _$SecondSubtypeFromJson(json),
145138 /// _ => throw Exception('Unknown type: ${json['type']}'),
146139 /// };
147- /// '''
148140 /// ```
149141 String _createSealedFunctionExpressionBody () {
150142 assert (element.isSealed);
@@ -178,7 +170,6 @@ _ => throw UnrecognizedUnionTypeException(
178170 ///
179171 /// For example:
180172 /// ```dart
181- /// '''
182173 /// $checkedCreate(
183174 /// 'FirstSubtype',
184175 /// json,
@@ -194,7 +185,6 @@ _ => throw UnrecognizedUnionTypeException(
194185 /// return val;
195186 /// },
196187 /// );
197- /// '''
198188 /// ```
199189 String _createCheckedFunctionExpressionBody (
200190 _ConstructorData data,
@@ -261,39 +251,31 @@ _ => throw UnrecognizedUnionTypeException(
261251 ///
262252 /// ```dart
263253 /// [
264- /// '''
265254 /// ExampleClass(
266255 /// json['exampleField'] as String,
267256 /// )
268- /// '''
269257 /// ]
270258 /// /* OR with fields to set */
271259 /// [
272- /// '''
273260 /// ExampleClass(
274261 /// json['exampleField'] as String,
275262 /// )
276263 /// ..field1 = json['field1'] as String
277- /// ..field2 = json['field2'] as String;
278- /// '''
264+ /// ..field2 = json['field2'] as String
279265 /// ]
280266 /// ```
281267 ///
282268 /// If there are checks, will return the checks followed by the
283269 /// constructor invocation.
284270 /// ```dart
285271 /// [
286- /// '''
287272 /// $checkKeys(
288273 /// json,
289274 /// allowedKeys: const ['exampleField', 'field1', 'field2'],
290- /// )
291- /// ''',
292- /// '''
275+ /// ),
293276 /// ExampleClass(
294277 /// json['exampleField'] as String,
295278 /// )
296- /// '''
297279 /// ]
298280 /// ```
299281 ///
0 commit comments