requiredTrue function
Creates a validator for boolean fields that fails when the value is false.
Commonly used for terms of service checkboxes or mandatory confirmations.
Returns message (or 'Must be accepted.' by default).
final termsField = BloomTypedFormField<bool>(
initialValue: false,
validators: [requiredTrue('You must accept the terms of service.')],
);
Implementation
String? Function(bool) requiredTrue([String? message]) =>
(v) => v ? null : (message ?? 'Must be accepted.');