MyTextEditor constructor
MyTextEditor({
- Key? key,
- required TextEditingController textController,
- required String label,
- String? hint,
- bool enabled = true,
- bool readOnly = false,
- bool clearable = false,
- FutureOr<
void> onCleared()?, - ValueChanged<
String> ? onChanged, - TextInputType? keyboardType,
- List<
TextInputFormatter> ? inputFormatters, - int? maxLines = 1,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical,
- Future<
List< getDropDownOptions()?,String> > - ValueChanged<
String> ? onOptionSelected, - Widget leadingBuilder()?,
- String displayStringForOption()?,
- bool filterOption()?,
- EdgeInsetsGeometry? dropDownItemPadding,
- Color? dropdownHighlightColor,
- int maxShowDropDownItems = 5,
- bool? showListCandidateBelow,
- bool showAllOnPopWithNonTyping = false,
- double? height,
- double? labelFontSize,
- double? textFontSize,
- double? hintFontSize,
- double? borderRadius,
- double? borderWidth,
- double? contentPadding,
- double? inSetVerticalPadding,
- double? inSetHorizontalPadding,
- Color normalBorderColor = const Color(0xFFE0E0E0),
- Color enabledBorderColor = const Color(0xFFE0E0E0),
- Color focusedBorderColor = const Color(0xFF64B5F6),
- Color? backgroundColor,
- Color? textColor,
- Color? hintColor,
- Color? labelColor,
- FontWeight? labelFontWeight,
- FontWeight? textFontWeight,
- bool isDense = true,
- bool showScrollbar = true,
- FloatingLabelBehavior floatingLabelBehavior = FloatingLabelBehavior.always,
- 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);
}