Flutter top 3 state management.
state management is the main part of the app. state management is used to control real-time updates in UI. there is inbuild state management in flutter SDK are setState and valueNotifier. but we talk about state management that is available in dart packages.
1. Get
We can also call GetX. GetX is the most popular package of dart packages. GetX is very simple to use. GetX is working on three simple principles PRODUCTIVITY, ORGANIZATION, and PERFORMANCE. GetX is capable of running with the same code on Android, IOS, Web, Mac, Linux, and Windows.
installation:
Add this dart package in pubspec.yaml file.
dependency:
get:
get:
Import get where you want to use it.
import 'package:get/get.dart';
more info on this package is here:-https://pub.dev/packages/get.
2. Provider
Provider is a dart package suggested by flutter. Provider is also getting flutter favorite tag in dart packages. Provider is easy to use. basically wrapper around the inherited widget.
installation:
Add this dart package to pubspec.yaml file.
dependency:
provider:
import get where you want to use it.
import 'package:get/get.dart';
more info on this package is here:https://pub.dev/packages/provider.
3. Flutter_Bloc
Flutter_Bloc makes it easy to integrate blocs and cubits into Flutter. Flutter_Bloc use the Bloc logic in the Fluttter. Bloc state as Bussiness Logic Component. Flutter_Bloc use in big and large apps and with Flutter_Bloc we managed a large amount of data.
installation:
Add this dart package to pubspec.yaml file.
dependency:
flutter_bloc:
Import flutter_bloc where you want to use it.
import'package:flutter_bloc/flutter_bloc.dart';
More info on this package is here:https://pub.dev/packages/flutter_bloc.