ilkersevim_type_safe_bloc 0.1.3 copy "ilkersevim_type_safe_bloc: ^0.1.3" to clipboard
ilkersevim_type_safe_bloc: ^0.1.3 copied to clipboard

Reduce flutter_bloc boilerplate with compile-time-safe context access and typed selector, builder, listener, and consumer widgets.

ilkersevim_type_safe_bloc #

Type-safe flutter_bloc helpers: BuildContext extensions and thin widgets around BlocSelector, BlocBuilder, BlocListener, and BlocConsumer.

Why use this package? #

  • Make each Cubit/BLoC and state relationship explicit at compile time.
  • Replace repeated context lookup and widget generic boilerplate with one consistent API.
  • Use nullable lookup helpers when a provider is optional, while retaining fail-fast access for required providers.

License: Apache-2.0. Issues: github.com/redjadet/ilkersevim_type_safe_bloc/issues.

Installation #

dependencies:
  ilkersevim_type_safe_bloc: ^0.1.2

Requires Flutter >=3.38.0, Dart >=3.12.0, flutter_bloc ^9.1.1.

Context extensions #

import 'package:ilkersevim_type_safe_bloc/ilkersevim_type_safe_bloc.dart';

final counterCubit = context.cubit<CounterCubit>();
final count = context.watchState<CounterCubit, CounterState>().count;

TypeSafeBlocSelector #

TypeSafeBlocSelector<CounterCubit, CounterState, int>(
  selector: (state) => state.count,
  builder: (context, count) => Text('Count: $count'),
)

API stability #

Public type names and method signatures are a semantic-versioned contract. Breaking changes require a major version bump.

Publishing #

Releases are tagged vX.Y.Z matching pubspec.yaml. Automated publishing uses GitHub Actions OIDC with the protected pub.dev Environment (reviewer: redjadet).

1
likes
160
points
384
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Reduce flutter_bloc boilerplate with compile-time-safe context access and typed selector, builder, listener, and consumer widgets.

Repository (GitHub)
View/report issues

Topics

#bloc #flutter #state-management

License

Apache-2.0 (license)

Dependencies

flutter, flutter_bloc, provider

More

Packages that depend on ilkersevim_type_safe_bloc