M3ETextField constructor

const M3ETextField({
  1. TextEditingController? controller,
  2. FocusNode? focusNode,
  3. String? label,
  4. String? supportingText,
  5. String? errorText,
  6. Widget? leading,
  7. Widget? trailing,
  8. M3ETextFieldVariant variant = M3ETextFieldVariant.filled,
  9. bool obscureText = false,
  10. bool enabled = true,
  11. TextInputType? keyboardType,
  12. TextInputAction? textInputAction,
  13. List<TextInputFormatter>? inputFormatters,
  14. ValueChanged<String>? onChanged,
  15. ValueChanged<String>? onSubmitted,
  16. TapRegionCallback? onTapOutside,
  17. int? maxLines = 1,
  18. int? minLines,
  19. bool readOnly = false,
  20. bool autofocus = false,
  21. bool isRequired = false,
  22. String? prefixText,
  23. String? suffixText,
  24. String? prefixSemanticsLabel,
  25. String? suffixSemanticsLabel,
  26. String? placeholder,
  27. int? maxLength,
  28. bool? showCounter,
  29. M3ETextFieldCounterLabelBuilder counterSemanticsLabelBuilder = m3eTextFieldCounterLabel,
  30. bool supportingTextOnFocusOnly = false,
  31. bool showErrorIcon = true,
  32. bool showClearButton = false,
  33. bool showPasswordToggle = false,
  34. String clearButtonSemanticsLabel = 'Clear',
  35. String showPasswordSemanticsLabel = 'Show password',
  36. String hidePasswordSemanticsLabel = 'Hide password',
  37. String errorIconSemanticsLabel = 'Error',
  38. MouseCursor? mouseCursor,
  39. EditableTextContextMenuBuilder? contextMenuBuilder = m3eDefaultTextFieldContextMenuBuilder,
  40. TextCapitalization textCapitalization = TextCapitalization.none,
  41. TextAlign textAlign = TextAlign.start,
  42. int? density,
  43. M3ETextFieldSlotAlignment? iconAlignment,
  44. M3ETextFieldSlotAlignment? affixAlignment,
  45. M3ETextFieldTheme? theme,
  46. VoidCallback? onTap,
  47. VoidCallback? onEditingComplete,
  48. Key? key,
})

M3ETextField.

Implementation

const M3ETextField({
  this.controller,
  this.focusNode,
  this.label,
  this.supportingText,
  this.errorText,
  this.leading,
  this.trailing,
  this.variant = M3ETextFieldVariant.filled,
  this.obscureText = false,
  this.enabled = true,
  this.keyboardType,
  this.textInputAction,
  this.inputFormatters,
  this.onChanged,
  this.onSubmitted,
  this.onTapOutside,
  this.maxLines = 1,
  this.minLines,
  this.readOnly = false,
  this.autofocus = false,
  this.isRequired = false,
  this.prefixText,
  this.suffixText,
  this.prefixSemanticsLabel,
  this.suffixSemanticsLabel,
  this.placeholder,
  this.maxLength,
  this.showCounter,
  this.counterSemanticsLabelBuilder = m3eTextFieldCounterLabel,
  this.supportingTextOnFocusOnly = false,
  this.showErrorIcon = true,
  this.showClearButton = false,
  this.showPasswordToggle = false,
  this.clearButtonSemanticsLabel = 'Clear',
  this.showPasswordSemanticsLabel = 'Show password',
  this.hidePasswordSemanticsLabel = 'Hide password',
  this.errorIconSemanticsLabel = 'Error',
  this.mouseCursor,
  this.contextMenuBuilder = m3eDefaultTextFieldContextMenuBuilder,
  this.textCapitalization = TextCapitalization.none,
  this.textAlign = TextAlign.start,
  this.density,
  this.iconAlignment,
  this.affixAlignment,
  this.theme,
  this.onTap,
  this.onEditingComplete,
  super.key,
}) : assert(
       !obscureText || maxLines == 1,
       'Obscured text fields cannot be multi-line.',
     ),
     assert(
       !showPasswordToggle || maxLines == 1,
       'The password toggle needs a single-line field.',
     );