bloc_network
2.1.3, released 8 weeks ago by stint.co
A package to bootstrap bloc state management for network queries and mutations.
WASM-ready
What it does
It helps reduce boilerplate when building blocs or cubits for network requests by providing pre-defined states and state transitions for both queries and mutations. It is fully compatible with flutter_bloc widgets and APIs.
AI-written summary of version 2.1.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are already using the bloc ecosystem and want standardized states for network requests.
- You want to manage query-like or mutation-like network operations with pre-defined states.
Skip it when
- You are using a different state management solution like Riverpod or Provider.
- You do not want to use the bloc architecture for your network calls.
Strengths
- Reduces boilerplate for network-related blocs and cubits.
- Compatible with the flutter_bloc ecosystem.
- Provides built-in query and mutation handling classes.
Weaknesses
- Strictly tied to the bloc state management library.
- Opinionated structure that may not fit every custom networking requirement.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
import 'package:bloc_network/bloc_network.dart';
class CostCubit extends QueryCubit<int> {
@override
Future<int> repositoryCallback(Object? extra) async {
await Future<void>.delayed(const Duration(seconds: 1));
return 5;
}
}Alternatives
Packages that do the same job and could replace bloc_network.
- flutter_bloc
Often used alongside bloc packages for widget binding.
86Compare - riverpod
If you prefer an alternative reactive state management library over bloc.
99Compare
Works with
Packages commonly used together with bloc_network: ones it builds on, ones built on it, and its own family.