initializeBuilder property

bool initializeBuilder
final

Marks a static method that will be called when the builder for the enclosing value type is initialized.

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

This example uses it to set a default value:

@BuiltValueHook(initializeBuilder: true)
static void _initialize(MyClassBuilder b) =>
   b..name = 'defaultName';

Defaults to `false`.

Implementation

final bool initializeBuilder;