bloc_storage 1.0.1
bloc_storage: ^1.0.1 copied to clipboard
A package for storing and retrieving BLoC instances globally.
Bloc Storage #
A lightweight package for storing and retrieving BLoC instances globally
- Easy storage of BLoC instances
- Easy retrieval of BLoC instances
- Clear specific or all stored BLoC instances
Basics #
Syntax #
To initiate a store , call the BlocStorage.store method, and pass the required
bloc:
BlocStorage.store<AuthBloc>(
context.read<AuthBloc>()
);
To retrieve a stored bloc, call the BlocStorage.retrieve method, and specify the required bloc
BlocStorage.retrieve<AuthBloc>();
To clear a stored bloc, call the BlocStorage.clear method, and specify the required bloc
BlocStorage.clear<AuthBloc>();
To clear all stored bloc, call the BlocStorage.clearAll method, and specify the required bloc
BlocStorage.clearAll();
Installation #
Grab it from pub.dev.