stateless_textfield 0.1.0 copy "stateless_textfield: ^0.1.0" to clipboard
stateless_textfield: ^0.1.0 copied to clipboard

A Stateless TextField having an initialValue parameter.

stateless_textfield #

A Stateless TextField having an initialValue parameter.

Motivation #

I wanted to use TextField having an initialValue parameter but the widget does not have initialValue.
I know that I can do similar using TextEditingController but there is a problem.
If I forget to dispose TextEditingController, a memory leak occur. This is very dangerous.
That is why, I made StatelessTextField. It has initialValue parameter and you do not have to think about state.

Usage #

StatelessTextField(
  initialValue: "initialValue",
  onSubmitted: (String str) {},
  decoration: InputDecoration(hintText: "first message field"),
);

Note #

This widget do not have a state.
Text on this widget will be reset when the widget rebuild.
You should put state of this widget a parent widget or a global variable (like redux, provider, etc...) .

0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A Stateless TextField having an initialValue parameter.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on stateless_textfield