how to keep the state of my widgets after scrolling? flutter

The solution for “how to keep the state of my widgets after scrolling? flutter” can be found here. The following code will assist you in solving the problem.

You can use AutomaticKeepAliveClientMixin of yout class widget to prevent your items to be
disposed when scrolled.

class _widgetState extends State with AutomaticKeepAliveClientMixin { …
//implement with
@override
bool get wantKeepAlive => true;

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in