A flutter package that manages dispose callbacks and subscriptions cancellations.
Features
This package provides helpful classes/mixins and extensions to dispose different flutter resources like
- Sync or Async callbacks
- StreamControllers
- StreamSubscriptions
- TextEditingController
- FocusNode
Getting started
Add the dependency on thep project's pubspec.yaml
dependencies:
disposable_container: ^0.0.1
Usage
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