Skip to main content

centralized_bloc 0.0.1 copy "centralized_bloc: ^0.0.1" to clipboard
centralized_bloc: ^0.0.1 copied to clipboard

A lightweight reusable Bloc architecture with centralized state handling, loading, error handling, and UI building.

example/lib/main.dart

import 'package:centralized_bloc/centralized_bloc.dart';
import 'package:example/bloc/user_bloc.dart';
import 'package:example/bloc/user_event.dart';
import 'package:example/repository/user_repository.dart';
import 'package:example/user_screen.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: BlocProvider(
        create: (_) => UserBloc(
          repository: UserRepository(),
        )..add(const LoadUser()),
        child: const UserScreen(),
      ),
    );
  }
}
1
likes
0
points
339
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight reusable Bloc architecture with centralized state handling, loading, error handling, and UI building.

License

unknown (license)

Dependencies

flutter, flutter_bloc

More

Packages that depend on centralized_bloc