InputHistoryTextField constructor
InputHistoryTextField({
- Key? key,
- required String historyKey,
- HistoryListItemLayoutBuilder? historyListItemLayoutBuilder,
- InputHistoryController? inputHistoryController,
- int limit = 5,
- bool hasFocusExpand = true,
- bool showHistoryIcon = true,
- bool showDeleteIcon = true,
- bool enableOpacityGradient = false,
- bool enableHistory = true,
- bool showHistoryList = true,
- bool enableFilterHistory = true,
- bool enableSave = true,
- IconData? historyIcon = Icons.history,
- IconData? deleteIcon = Icons.close,
- ListStyle? listStyle = ListStyle.List,
- @Deprecated('use `backgroundColor` instead ') Color? badgeColor,
- Color? backgroundColor,
- Color? textColor,
- Color? historyIconColor,
- Color? deleteIconColor,
- Decoration? listDecoration,
- Decoration? listRowDecoration,
- TextEditingController? textEditingController,
- Offset? listOffset,
- List<
String> ? lockItems, - Color? lockTextColor,
- Color? lockBackgroundColor,
- IconTheme? historyIconTheme,
- IconTheme? deleteIconTheme,
- TextStyle? listTextStyle,
- FocusNode? focusNode,
- InputDecoration decoration = const InputDecoration(),
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign textAlign = TextAlign.start,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- bool readOnly = false,
- ToolbarOptions? toolbarOptions,
- bool? showCursor,
- bool autofocus = false,
- bool obscureText = false,
- bool autocorrect = true,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool enableSuggestions = true,
- int maxLines = 1,
- int? minLines,
- bool expands = false,
- int? maxLength,
- MaxLengthEnforcement? maxLengthEnforcement = MaxLengthEnforcement.none,
- ValueChanged<
String> ? onChanged, - VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmitted, - List<
TextInputFormatter> ? inputFormatters, - bool? enabled,
- double cursorWidth = 2.0,
- Radius? cursorRadius,
- Color? cursorColor,
- BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
- BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool enableInteractiveSelection = true,
- GestureTapCallback? onTap,
- InputCounterWidgetBuilder? buildCounter,
- ScrollController? scrollController,
- ScrollPhysics? scrollPhysics,
Implementation
InputHistoryTextField(
{Key? key,
required this.historyKey,
this.historyListItemLayoutBuilder,
this.inputHistoryController,
this.limit = 5,
this.hasFocusExpand = true,
this.showHistoryIcon = true,
this.showDeleteIcon = true,
this.enableOpacityGradient = false,
this.enableHistory = true,
this.showHistoryList = true,
this.enableFilterHistory = true,
this.enableSave = true,
this.historyIcon = Icons.history,
this.deleteIcon = Icons.close,
this.listStyle = ListStyle.List,
@Deprecated('use `backgroundColor` instead ') this.badgeColor,
this.backgroundColor,
this.textColor,
this.historyIconColor,
this.deleteIconColor,
this.listDecoration,
this.listRowDecoration,
this.textEditingController,
this.listOffset,
this.lockItems,
this.lockTextColor,
this.lockBackgroundColor,
this.historyIconTheme,
this.deleteIconTheme,
this.listTextStyle,
this.focusNode,
this.decoration = const InputDecoration(),
TextInputType? keyboardType,
this.textInputAction,
this.textCapitalization = TextCapitalization.none,
this.style,
this.strutStyle,
this.textAlign = TextAlign.start,
this.textAlignVertical,
this.textDirection,
this.readOnly = false,
ToolbarOptions? toolbarOptions,
this.showCursor,
this.autofocus = false,
this.obscureText = false,
this.autocorrect = true,
SmartDashesType? smartDashesType,
SmartQuotesType? smartQuotesType,
this.enableSuggestions = true,
this.maxLines = 1,
this.minLines,
this.expands = false,
this.maxLength,
this.maxLengthEnforcement = MaxLengthEnforcement.none,
this.onChanged,
this.onEditingComplete,
this.onSubmitted,
this.inputFormatters,
this.enabled,
this.cursorWidth = 2.0,
this.cursorRadius,
this.cursorColor,
this.selectionHeightStyle = ui.BoxHeightStyle.tight,
this.selectionWidthStyle = ui.BoxWidthStyle.tight,
this.keyboardAppearance,
this.scrollPadding = const EdgeInsets.all(20.0),
this.dragStartBehavior = DragStartBehavior.start,
this.enableInteractiveSelection = true,
this.onTap,
this.buildCounter,
this.scrollController,
this.scrollPhysics})
:
smartDashesType = smartDashesType ??
(obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
smartQuotesType = smartQuotesType ??
(obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled),
assert(maxLines > 0),
assert(
(minLines == null) || (maxLines >= minLines),
"minLines can't be greater than maxLines",
),
assert(
!expands || (minLines == null),
'minLines and maxLines must be null when expands is true.',
),
assert(!obscureText || maxLines == 1,
'Obscured fields cannot be multiline.'),
assert(maxLength == null ||
maxLength == TextField.noMaxLength ||
maxLength > 0),
keyboardType = keyboardType ??
(maxLines == 1 ? TextInputType.text : TextInputType.multiline),
toolbarOptions = toolbarOptions ??
(obscureText
? const ToolbarOptions(
selectAll: true,
paste: true,
)
: const ToolbarOptions(
copy: true,
cut: true,
selectAll: true,
paste: true,
)),
super(key: key);