A flutter package that manages dispose callbacks and subscriptions cancellations.
This package provides helpful classes/mixins and extensions to dispose different flutter resources like
- Sync or Async callbacks
- StreamControllers
- StreamSubscriptions
- TextEditingController
- FocusNode
Add the dependency on thep project's pubspec.yaml
dependencies:
disposable_container: ^0.0.1
import 'package:disposable_container/disposable_container.dart';
void main() {
final DisposableContainer disposableContainer = DisposableContainer();
disposableContainer.addDisposable(() => print('I will be disposed'));
await disposableContainer.dispose();
}
Find more examples