TextEditingControllerFS extension

provides extensions on TextEditingController

on

Properties

isBlank bool
Returns true if the text is empty or only contains white-spaces
no setter
isNotBlank bool
Returns true if the text is not empty or contains characters other than white-spaces.
no setter
trimmed String
Returns trimmed text
no setter

Methods

onChanged(void block(String text)) Disposable
Unlike addListener, this only calls block when the text actually changes. This won't be invoked when the focus or selection of the text changes in TextField or TextFormField.
onSelectionChanged(void block(TextSelection selection)) Disposable
Unlike addListener, this only calls block when the selection of text actually changes. This won't be invoked when the focus or text value of the text changes in TextField or TextFormField.
selectionChanges() Stream<TextSelection>
Returns a stream of text selection changes Note that as this is an extension, it will return a new stream object every time this method is called. Call this method once and store it in a variable for further use.
textChanges() Stream<String>
Returns a stream of text changes. Note that as this is an extension, it will return a new stream object every time this method is called. Call this method once and store it in a variable for further use.
whenBlank(VoidCallback block) → void
Executes block function only when text is blank.