bloc_dispose_scope 1.0.0
bloc_dispose_scope: ^1.0.0 copied to clipboard

Package supporting bloc types for dispose_scope.

BlocDisposeScope #

BlocDisposeScope adds support for bloc related types to dispose_scope package.

Usage #

import 'package:bloc_dispose_scope/bloc_dispose_scope.dart';

class MainCubit extends Cubit<String> with BlocBaseDisposeScopeMixin {
  MainCubit(this._dependencyCubit) : super('') {
    // StreamSubscription will be cancelled when MainCubit is closed
    _dependencyCubit.stream
        .listen(_onDependencyCubitStateChanged)
        .disposed(scope);
  }

  final DependencyCubit _dependencyCubit;

  void _onDependencyCubitStateChanged(String dependencyState) {}
}