finalizeBuilder property

bool finalizeBuilder
final

Marks a static method that will be called immediately before the builder for the enclosing value type is built.

The method must accept a builder of the enclosing value type.

This example uses it to make items sorted:

@BuiltValueHook(finalizeBuilder: true)
static void _finalize(MyClassBuilder b) =>
   b..items.sort();

Defaults to `false`.

Implementation

final bool finalizeBuilder;