We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
??
It is common way to write widget which can optionally take controller as its own property.
You should handle null case for such controller in initState or lazy variable declaration:
initState
late final _controller = widget.controller ?? TextEditingController(text: widget.initialValue);
lint suggest you next rewriting:
late final _controller = widget.controller ?? TextEditingController(text: widget.initialValue).closeWith(this);
which you can read as
late final _controller = widget.controller ?? (TextEditingController(text: widget.initialValue).closeWith(this));
but it is actually
late final _controller = (widget.controller ?? TextEditingController(text: widget.initialValue)).closeWith(this);
So in case when widget's property controller is not null it will possibly closed sooner than it should.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It is common way to write widget which can optionally take controller as its own property.
You should handle null case for such controller in
initState
or lazy variable declaration:lint suggest you next rewriting:
which you can read as
but it is actually
So in case when widget's property controller is not null it will possibly closed sooner than it should.
The text was updated successfully, but these errors were encountered: