@@ -18,7 +18,7 @@ abstract class Built<V extends Built<V, B>, B extends Builder<V, B>> {
18
18
///
19
19
/// The implementation of this method will be generated for you by the
20
20
/// built_value generator.
21
- V rebuild (Function (B ) updates);
21
+ V rebuild (void Function (B ) updates);
22
22
23
23
/// Converts the instance to a builder [B] .
24
24
///
@@ -43,7 +43,7 @@ abstract class Builder<V extends Built<V, B>, B extends Builder<V, B>> {
43
43
/// Applies updates.
44
44
///
45
45
/// [updates] is a function that takes a builder [B] .
46
- void update (Function (B )? updates);
46
+ void update (void Function (B )? updates);
47
47
48
48
/// Builds.
49
49
///
@@ -117,15 +117,16 @@ class BuiltValue {
117
117
/// to serialize with `@BuiltValueField(serialize: true)` .
118
118
final bool defaultSerialize;
119
119
120
- const BuiltValue (
121
- {this .instantiable = true ,
122
- this .nestedBuilders = true ,
123
- this .autoCreateNestedBuilders = true ,
124
- this .comparableBuilders = false ,
125
- this .generateBuilderOnSetField = false ,
126
- this .wireName,
127
- this .defaultCompare = true ,
128
- this .defaultSerialize = true });
120
+ const BuiltValue ({
121
+ this .instantiable = true ,
122
+ this .nestedBuilders = true ,
123
+ this .autoCreateNestedBuilders = true ,
124
+ this .comparableBuilders = false ,
125
+ this .generateBuilderOnSetField = false ,
126
+ this .wireName,
127
+ this .defaultCompare = true ,
128
+ this .defaultSerialize = true ,
129
+ });
129
130
}
130
131
131
132
/// Annotation that was used to mark nullable Built Value fields.
@@ -156,20 +157,23 @@ class BuiltValueField {
156
157
/// indicates the name is to be taken from the literal field name.
157
158
final String ? wireName;
158
159
159
- /// Whether the field overrides the `nestedBuilders` setting from the class. Defaults to `null` which
160
- /// indicates the setting is to be taken from the `nestedBuilders` setting on the class.
160
+ /// Whether the field overrides the `nestedBuilders` setting from the class.
161
+ /// Defaults to `null` which indicates the setting is to be taken from the
162
+ /// `nestedBuilders` setting on the class.
161
163
final bool ? nestedBuilder;
162
164
163
- /// Whether the field overrides the `autoCreateNestedBuilders` setting from the class. Defaults to `null` which
164
- /// indicates the setting is to be taken from the `autoCreateNestedBuilders` setting on the class.
165
+ /// Whether the field overrides the `autoCreateNestedBuilders` setting from
166
+ /// the class. Defaults to `null` which indicates the setting is to be taken
167
+ /// from the `autoCreateNestedBuilders` setting on the class.
165
168
final bool ? autoCreateNestedBuilder;
166
169
167
- const BuiltValueField (
168
- {this .compare,
169
- this .serialize,
170
- this .wireName,
171
- this .nestedBuilder,
172
- this .autoCreateNestedBuilder});
170
+ const BuiltValueField ({
171
+ this .compare,
172
+ this .serialize,
173
+ this .wireName,
174
+ this .nestedBuilder,
175
+ this .autoCreateNestedBuilder,
176
+ });
173
177
}
174
178
175
179
/// Optionally, annotate a Built Value `Serializer` getters with this to
@@ -187,8 +191,10 @@ class BuiltValueSerializer {
187
191
188
192
final bool serializeNulls;
189
193
190
- const BuiltValueSerializer (
191
- {this .custom = false , this .serializeNulls = false });
194
+ const BuiltValueSerializer ({
195
+ this .custom = false ,
196
+ this .serializeNulls = false ,
197
+ });
192
198
}
193
199
194
200
/// Memoized annotation for Built Value getters.
@@ -235,8 +241,11 @@ class BuiltValueEnumConst {
235
241
/// the fallback, if available, rather than throwing an exception.
236
242
final bool fallback;
237
243
238
- const BuiltValueEnumConst (
239
- {this .wireName, this .wireNumber, this .fallback = false });
244
+ const BuiltValueEnumConst ({
245
+ this .wireName,
246
+ this .wireNumber,
247
+ this .fallback = false ,
248
+ });
240
249
}
241
250
242
251
/// Optionally, annotate methods with this to cause them to be called by
@@ -275,8 +284,10 @@ class BuiltValueHook {
275
284
/// ```
276
285
final bool finalizeBuilder;
277
286
278
- const BuiltValueHook (
279
- {this .initializeBuilder = false , this .finalizeBuilder = false });
287
+ const BuiltValueHook ({
288
+ this .initializeBuilder = false ,
289
+ this .finalizeBuilder = false ,
290
+ });
280
291
}
281
292
282
293
/// Enum Class base class.
@@ -319,7 +330,7 @@ typedef BuiltValueToStringHelperProvider = BuiltValueToStringHelper Function(
319
330
/// are [IndentingBuiltValueToStringHelper] , which is the default, and
320
331
/// [FlatBuiltValueToStringHelper] .
321
332
BuiltValueToStringHelperProvider newBuiltValueToStringHelper =
322
- ( String className) => IndentingBuiltValueToStringHelper (className) ;
333
+ IndentingBuiltValueToStringHelper . new ;
323
334
324
335
/// Interface for built_value toString() output helpers.
325
336
///
@@ -422,7 +433,8 @@ class BuiltValueNullFieldError extends Error {
422
433
423
434
@override
424
435
String toString () =>
425
- 'Tried to construct class "$type " with null for non-nullable field "$field ".' ;
436
+ 'Tried to construct class "$type " with null for non-nullable field '
437
+ '"$field ".' ;
426
438
}
427
439
428
440
/// [Error] indicating that a built_value class constructor was called with
0 commit comments