valueTransformer property Null safety

ValueTransformer<T?>? valueTransformer

Called just before field value is saved. Used to massage data just before committing the value.

This sample shows how to convert age in a FormBuilderTextField to number so that the final value is numeric instead of a String

    name: 'age',
    decoration: InputDecoration(labelText: 'Age'),
    valueTransformer: (text) => num.tryParse(text),
    validator: FormBuilderValidators.numeric(context),
    initialValue: '18',
    keyboardType: TextInputType.number,


final ValueTransformer<T?>? valueTransformer;