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/element2.dart' ;
86import 'package:analyzer/dart/element/nullability_suffix.dart' ;
97import 'package:build/build.dart' ;
@@ -86,22 +84,18 @@ mixin DecodeHelper implements HelperCore {
8684 /// If [functionBodyParts] has only one element, expression body is used.
8785 ///
8886 /// ```dart
89- /// '''
9087 /// ExampleClass _$ExampleClassFromJson(Map<String, dynamic> json) =>
9188 /// /* only body part here */
92- /// '''
9389 /// ```
9490 ///
9591 /// If [functionBodyParts] has more than one element, block body is used.
9692 ///
9793 /// ```dart
98- /// '''
9994 /// ExampleClass _$ExampleClassFromJson(Map<String, dynamic> json) {
10095 /// /* first body parts here */
10196 ///
10297 /// return /* last body part here */;
10398 /// }
104- /// '''
10599 /// ```
106100 String _createFromJsonFunctionSignature (Iterable <String > functionBodyParts) {
107101 final mapType = config.anyMap ? 'Map' : 'Map<String, dynamic>' ;
@@ -145,13 +139,11 @@ mixin DecodeHelper implements HelperCore {
145139 ///
146140 /// For example:
147141 /// ```dart
148- /// '''
149142 /// switch (json['type']) {
150143 /// 'FirstSubtype' => _$FirstSubtypeFromJson(json),
151144 /// 'SecondSubtype' => _$SecondSubtypeFromJson(json),
152145 /// _ => throw Exception('Unknown type: ${json['type']}'),
153146 /// };
154- /// '''
155147 /// ```
156148 String _createSealedFunctionExpressionBody () {
157149 assert (element.isSealed);
@@ -185,7 +177,6 @@ _ => throw UnrecognizedUnionTypeException(
185177 ///
186178 /// For example:
187179 /// ```dart
188- /// '''
189180 /// $checkedCreate(
190181 /// 'FirstSubtype',
191182 /// json,
@@ -201,7 +192,6 @@ _ => throw UnrecognizedUnionTypeException(
201192 /// return val;
202193 /// },
203194 /// );
204- /// '''
205195 /// ```
206196 String _createCheckedFunctionExpressionBody (
207197 _ConstructorData data,
@@ -268,39 +258,31 @@ _ => throw UnrecognizedUnionTypeException(
268258 ///
269259 /// ```dart
270260 /// [
271- /// '''
272261 /// ExampleClass(
273262 /// json['exampleField'] as String,
274263 /// )
275- /// '''
276264 /// ]
277265 /// /* OR with fields to set */
278266 /// [
279- /// '''
280267 /// ExampleClass(
281268 /// json['exampleField'] as String,
282269 /// )
283270 /// ..field1 = json['field1'] as String
284- /// ..field2 = json['field2'] as String;
285- /// '''
271+ /// ..field2 = json['field2'] as String
286272 /// ]
287273 /// ```
288274 ///
289275 /// If there are checks, will return the checks followed by the
290276 /// constructor invocation.
291277 /// ```dart
292278 /// [
293- /// '''
294279 /// $checkKeys(
295280 /// json,
296281 /// allowedKeys: const ['exampleField', 'field1', 'field2'],
297- /// )
298- /// ''',
299- /// '''
282+ /// ),
300283 /// ExampleClass(
301284 /// json['exampleField'] as String,
302285 /// )
303- /// '''
304286 /// ]
305287 /// ```
306288 ///
0 commit comments