TagEditor<T> class

A Widget for editing tag similar to Google's Gmail email address input widget in the iOS app.

Inheritance

Constructors

TagEditor({required int length, double minTextFieldWidth = 160.0, double tagSpacing = 4.0, required Widget tagBuilder(BuildContext, int), required ValueChanged<String> onTagChanged, required SuggestionBuilder<T> suggestionBuilder, required InputSuggestions<T> findSuggestions, Key? key, FocusNode? focusNode, bool hasAddButton = true, List<String> delimiters = const [], IconData? icon, bool enabled = true, TextEditingController? controller, TextStyle? textStyle, InputDecoration inputDecoration = const InputDecoration(), TextInputType? keyboardType, TextInputAction? textInputAction, TextCapitalization textCapitalization = TextCapitalization.none, TextAlign textAlign = TextAlign.start, TextDirection? textDirection, bool readOnly = false, bool autofocus = false, bool autocorrect = false, bool enableSuggestions = true, int maxLines = 1, bool resetTextOnSubmitted = false, ValueChanged<String>? onSubmitted, List<TextInputFormatter>? inputFormatters, Brightness? keyboardAppearance, double? suggestionsBoxMaxHeight, double? suggestionsBoxElevation, Color? suggestionsBoxBackgroundColor, double? suggestionsBoxRadius, Widget? iconSuggestionBox, SearchSuggestions<T>? searchAllSuggestions, Duration? debounceDuration, bool activateSuggestionBox = true, Color? cursorColor, Color? backgroundColor, Color? focusedBorderColor, Color? enableBorderColor, double? borderRadius, double? borderSize, EdgeInsets? padding, EdgeInsets? suggestionPadding, bool autoDisposeFocusNode = true, EdgeInsets? suggestionMargin, OnDeleteTagAction? onDeleteTagAction, OnFocusTagAction? onFocusTagAction, Color? itemHighlightColor, bool useDefaultHighlight = true, bool enableFocusAfterEnter = true, OnSelectOptionAction<T>? onSelectOptionAction})
const

Properties

activateSuggestionBox bool
final
autocorrect bool
final
autoDisposeFocusNode bool
final
autofocus bool
final
backgroundColor Color?
final
borderRadius double?
final
borderSize double?
final
controller TextEditingController?
TextField's properties.
final
cursorColor Color?
final
debounceDuration Duration?
final
delimiters List<String>
When the string value in this delimiters is found, a new tag will be created and onTagChanged is called.
final
enableBorderColor Color?
final
enabled bool
final
enableFocusAfterEnter bool
final
enableSuggestions bool
final
findSuggestions InputSuggestions<T>
final
focusedBorderColor Color?
final
focusNode FocusNode?
Focus node for checking if the TextField is focused.
final
hasAddButton bool
Show the add button to the right.
final
hashCode int
The hash code for this object.
no setterinherited
icon IconData?
The icon for the add button enabled with hasAddButton.
final
iconSuggestionBox Widget?
final
inputDecoration InputDecoration
final
inputFormatters List<TextInputFormatter>?
final
itemHighlightColor Color?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardAppearance Brightness?
final
keyboardType TextInputType?
final
length int
The number of tags currently shown.
final
maxLines int
final
minTextFieldWidth double
The minimum width that the TextField should take
final
onDeleteTagAction OnDeleteTagAction?
final
onFocusTagAction OnFocusTagAction?
final
onSelectOptionAction OnSelectOptionAction<T>?
final
onSubmitted ValueChanged<String>?
Called when the user are done editing the text in the TextField Use this to get the outstanding text that aren't converted to tag yet If no text is entered when this is called an empty string will be passed.
final
onTagChanged ValueChanged<String>
Callback for when the tag changed. Use this to get the new tag and add it to the state.
final
padding EdgeInsets?
final
readOnly bool
final
resetTextOnSubmitted bool
Reset the TextField when onSubmitted is called this is default to false because when the form is submitted usually the outstanding value is just used, but this option is here in case you want to reset it for any reasons (like converting the outstanding value to tag).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchAllSuggestions SearchSuggestions<T>?
final
suggestionBuilder SuggestionBuilder<T>
final
suggestionMargin EdgeInsets?
final
suggestionPadding EdgeInsets?
final
suggestionsBoxBackgroundColor Color?
final
suggestionsBoxElevation double?
final
suggestionsBoxMaxHeight double?
SuggestionBox's properties.
final
suggestionsBoxRadius double?
final
tagBuilder Widget Function(BuildContext, int)
Builder for building the tags, this usually use Flutter's Material Chip.
final
tagSpacing double
The spacing between each tag
final
textAlign TextAlign
final
textCapitalization TextCapitalization
final
textDirection TextDirection?
final
textInputAction TextInputAction?
final
textStyle TextStyle?
final
useDefaultHighlight bool
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() TagsEditorState<T>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited