flutterriverpod

Is it okay to make a nested ConsumerStatefulWidget?


Is it okay to make a nested ConsumerStatefulWidget in a single screen? Each ConsumerStatefulWidget has ref.watch(someAsyncNotifierProvider) in it.


Solution

  • It’s perfectly acceptable. The key is to watch providers only where necessary, ensuring efficient state management.

    To optimize rebuilds, you can: