autoclose_bloc 1.0.3 copy "autoclose_bloc: ^1.0.3" to clipboard
autoclose_bloc: ^1.0.3 copied to clipboard

autoclose_bloc is a package providing AutoClose functionality for the Bloc

example/example.dart

import 'package:autoclose_bloc/closer/closer_bloc.dart';
import 'package:bloc/bloc.dart';

class ProfileEditingFormBloc
    extends Bloc<ProfileEditingFormEvent, ProfileEditingFormState>
    with CloserBloc {
  final UserRepository userRepository;

  ProfileEditingFormBloc({
    required this.userRepository,
  }) {
    on<ProfileFetchRenewedUserData>(_onProfileFetchRenewedUserData);
    // ... other events

    userRepository.userAuthTokenStream.listen((token) {
      add(ProfileFetchRenewedUserData(token: token));
    }).closeWith(this);
  }
}
0
likes
0
points
61
downloads

Publisher

unverified uploader

Weekly Downloads

autoclose_bloc is a package providing AutoClose functionality for the Bloc

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

autoclose, bloc

More

Packages that depend on autoclose_bloc