InputHistoryTextField constructor

InputHistoryTextField({
  1. Key? key,
  2. required String historyKey,
  3. HistoryListItemLayoutBuilder? historyListItemLayoutBuilder,
  4. InputHistoryController? inputHistoryController,
  5. int limit = 5,
  6. bool hasFocusExpand = true,
  7. bool showHistoryIcon = true,
  8. bool showDeleteIcon = true,
  9. bool enableOpacityGradient = false,
  10. bool enableHistory = true,
  11. bool showHistoryList = true,
  12. bool enableFilterHistory = true,
  13. bool enableSave = true,
  14. IconData? historyIcon = Icons.history,
  15. IconData? deleteIcon = Icons.close,
  16. ListStyle? listStyle = ListStyle.List,
  17. @Deprecated('use `backgroundColor` instead ') Color? badgeColor,
  18. Color? backgroundColor,
  19. Color? textColor,
  20. Color? historyIconColor,
  21. Color? deleteIconColor,
  22. Decoration? listDecoration,
  23. Decoration? listRowDecoration,
  24. TextEditingController? textEditingController,
  25. Offset? listOffset,
  26. List<String>? lockItems,
  27. Color? lockTextColor,
  28. Color? lockBackgroundColor,
  29. IconTheme? historyIconTheme,
  30. IconTheme? deleteIconTheme,
  31. TextStyle? listTextStyle,
  32. FocusNode? focusNode,
  33. InputDecoration decoration = const InputDecoration(),
  34. TextInputType? keyboardType,
  35. TextInputAction? textInputAction,
  36. TextCapitalization textCapitalization = TextCapitalization.none,
  37. TextStyle? style,
  38. StrutStyle? strutStyle,
  39. TextAlign textAlign = TextAlign.start,
  40. TextAlignVertical? textAlignVertical,
  41. TextDirection? textDirection,
  42. bool readOnly = false,
  43. ToolbarOptions? toolbarOptions,
  44. bool? showCursor,
  45. bool autofocus = false,
  46. bool obscureText = false,
  47. bool autocorrect = true,
  48. SmartDashesType? smartDashesType,
  49. SmartQuotesType? smartQuotesType,
  50. bool enableSuggestions = true,
  51. int maxLines = 1,
  52. int? minLines,
  53. bool expands = false,
  54. int? maxLength,
  55. MaxLengthEnforcement? maxLengthEnforcement = MaxLengthEnforcement.none,
  56. ValueChanged<String>? onChanged,
  57. VoidCallback? onEditingComplete,
  58. ValueChanged<String>? onSubmitted,
  59. List<TextInputFormatter>? inputFormatters,
  60. bool? enabled,
  61. double cursorWidth = 2.0,
  62. Radius? cursorRadius,
  63. Color? cursorColor,
  64. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  65. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  66. Brightness? keyboardAppearance,
  67. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  68. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  69. bool enableInteractiveSelection = true,
  70. GestureTapCallback? onTap,
  71. InputCounterWidgetBuilder? buildCounter,
  72. ScrollController? scrollController,
  73. 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);