when to use provider vs changenotifierprovider flutter code example
Example: provider flutter changeNotifierProvider
######## SINGLE MODEL #############
Provider(
create: (_) => MyModel(),
child: ...
)
######## MULTIPLE MODELS #############
MultiProvider(
providers: [
Provider<MY_MODEL1>(create: (_) => MY_MODEL1()),
Provider<MY_MODEL2>(create: (_) => MY_MODEL2()),
Provider<MY_MODEL3>(create: (_) => MY_MODEL3()),
],
child: someWidget,
)