MyTextEditor constructor

MyTextEditor({
  1. Key? key,
  2. required TextEditingController textController,
  3. required String label,
  4. String? hint,
  5. bool enabled = true,
  6. bool readOnly = false,
  7. bool clearable = false,
  8. FutureOr<void> onCleared()?,
  9. ValueChanged<String>? onChanged,
  10. TextInputType? keyboardType,
  11. List<TextInputFormatter>? inputFormatters,
  12. int? maxLines = 1,
  13. TextAlign textAlign = TextAlign.start,
  14. TextAlignVertical? textAlignVertical,
  15. Future<List<String>> getDropDownOptions()?,
  16. ValueChanged<String>? onOptionSelected,
  17. Widget leadingBuilder(
    1. String
    )?,
  18. String displayStringForOption(
    1. String
    )?,
  19. bool filterOption(
    1. String option,
    2. String input
    )?,
  20. EdgeInsetsGeometry? dropDownItemPadding,
  21. Color? dropdownHighlightColor,
  22. int maxShowDropDownItems = 5,
  23. bool? showListCandidateBelow,
  24. bool showAllOnPopWithNonTyping = false,
  25. double? height,
  26. double? labelFontSize,
  27. double? textFontSize,
  28. double? hintFontSize,
  29. double? borderRadius,
  30. double? borderWidth,
  31. double? contentPadding,
  32. double? inSetVerticalPadding,
  33. double? inSetHorizontalPadding,
  34. Color normalBorderColor = const Color(0xFFE0E0E0),
  35. Color enabledBorderColor = const Color(0xFFE0E0E0),
  36. Color focusedBorderColor = const Color(0xFF64B5F6),
  37. Color? backgroundColor,
  38. Color? textColor,
  39. Color? hintColor,
  40. Color? labelColor,
  41. FontWeight? labelFontWeight,
  42. FontWeight? textFontWeight,
  43. bool isDense = true,
  44. bool showScrollbar = true,
  45. FloatingLabelBehavior floatingLabelBehavior = FloatingLabelBehavior.always,
  46. FloatingLabelAlignment floatingLabelAlignment = FloatingLabelAlignment.start,
})

Creates a text editor with customizable properties.

The textController and label parameters are required.

Implementation

MyTextEditor({
  super.key,
  // Core properties
  required this.textController,
  required this.label,
  this.hint,
  this.enabled = true,
  this.readOnly = false,
  this.clearable = false,
  this.onCleared,
  this.onChanged,

  // Input properties
  this.keyboardType,
  this.inputFormatters,
  this.maxLines = 1,
  this.textAlign = TextAlign.start,
  this.textAlignVertical,

  // Dropdown properties
  this.getDropDownOptions,
  this.onOptionSelected,
  this.leadingBuilder,
  this.displayStringForOption,
  this.filterOption,
  this.dropDownItemPadding,
  this.dropdownHighlightColor,
  this.maxShowDropDownItems = 5,
  this.showListCandidateBelow,
  this.showAllOnPopWithNonTyping = false,

  // Style properties - Size
  this.height,
  this.labelFontSize,
  this.textFontSize,
  this.hintFontSize,
  this.borderRadius,
  this.borderWidth,
  this.contentPadding,
  this.inSetVerticalPadding,
  this.inSetHorizontalPadding,

  // Style properties - Color
  this.normalBorderColor = const Color(0xFFE0E0E0),
  this.enabledBorderColor = const Color(0xFFE0E0E0),
  this.focusedBorderColor = const Color(0xFF64B5F6),
  this.backgroundColor,
  this.textColor,
  this.hintColor,
  this.labelColor,

  // Style properties - Font Weight
  this.labelFontWeight,
  this.textFontWeight,

  // Layout properties
  this.isDense = true,
  this.showScrollbar = true,
  this.floatingLabelBehavior = FloatingLabelBehavior.always,
  this.floatingLabelAlignment = FloatingLabelAlignment.start,
}) : uniqueId = UniqueKey().toString() {
  Get.put(MyTextEditorController(), tag: uniqueId);
}