provider
provider copied to clipboard
store and pass widget in provider
Can I store and pass widget as a variable in provider mode? Will this be a performance issue?
you should not be passing around widgets over provider. widgets are ephemeral and should be built from data, not represent data.
you could still provide widgets with provider, but I strongly recommend not doing so. instead provider an object with the necessary fields to build the widgets you want.
It's technically possible (since widgets are plain immutable classes), but not recommended. As you'd likely be better off just creating yourwidget inside your build method