FastAmountSwitchField constructor
const
FastAmountSwitchField({
- Key? key,
- required dynamic onFieldTypeChanged(),
- dynamic onAmountValueChanged()?,
- dynamic onPercentValueChanged()?,
- String? percentCaptionText,
- String? amountCaptionText,
- String? percentLabelText,
- String? amountLabelText,
- String? amountMenuText,
- String? percentMenuText,
- String? percentPlaceholderText,
- String? amountPlaceholderText,
- String? percentValue,
- String? amountValue,
- FastAmountSwitchFieldType? fieldType,
- List<
FastAmountSwitchMenuOption> ? availableMenuOptions = kDefaultMenuOptions, - bool? isEnabled,
- bool? transformInvalidNumber = true,
Implementation
const FastAmountSwitchField({
super.key,
required this.onFieldTypeChanged,
// Value callbacks
this.onAmountValueChanged,
this.onPercentValueChanged,
// Caption texts
this.percentCaptionText,
this.amountCaptionText,
// Label texts
this.percentLabelText,
this.amountLabelText,
// Menu texts
this.amountMenuText,
this.percentMenuText,
// Placeholder texts
String? percentPlaceholderText,
String? amountPlaceholderText,
// Values
String? percentValue,
String? amountValue,
// Field type and menu options
FastAmountSwitchFieldType? fieldType,
List<FastAmountSwitchMenuOption>? availableMenuOptions =
kDefaultMenuOptions,
bool? isEnabled,
bool? transformInvalidNumber = true,
}) : availableMenuOptions = availableMenuOptions ?? kDefaultMenuOptions,
fieldType = fieldType ?? kDefaultFieldType,
percentValue = percentValue ?? '',
amountValue = amountValue ?? '',
isEnabled = isEnabled ?? true,
percentPlaceholderText =
percentPlaceholderText ?? kDefaultPlaceholderText,
amountPlaceholderText =
amountPlaceholderText ?? kDefaultPlaceholderText,
transformInvalidNumber = transformInvalidNumber ?? true;