FastAmountSwitchField constructor

const FastAmountSwitchField({
  1. Key? key,
  2. required dynamic onFieldTypeChanged(
    1. FastAmountSwitchFieldType
    ),
  3. dynamic onAmountValueChanged(
    1. String
    )?,
  4. dynamic onPercentValueChanged(
    1. String
    )?,
  5. String? percentCaptionText,
  6. String? amountCaptionText,
  7. String? percentLabelText,
  8. String? amountLabelText,
  9. String? amountMenuText,
  10. String? percentMenuText,
  11. String? percentPlaceholderText,
  12. String? amountPlaceholderText,
  13. String? percentValue,
  14. String? amountValue,
  15. FastAmountSwitchFieldType? fieldType,
  16. List<FastAmountSwitchMenuOption>? availableMenuOptions = kDefaultMenuOptions,
  17. bool? isEnabled,
  18. 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;