Simple app state management | Flutter

PHOTO EMBED

Thu Sep 14 2023 15:50:52 GMT+0000 (Coordinated Universal Time)

Saved by @Adorism80 #dart

void main() {
  runApp(
    ChangeNotifierProvider(
      create: (context) => CartModel(),
      child: const MyApp(),
    ),
  );
}
content_copyCOPY

Put this at the lowest possible place in your app so that all widgets needing to be able to observe the state can have access.

https://docs.flutter.dev/data-and-backend/state-mgmt/simple