dispose_scope 1.0.0 copy "dispose_scope: ^1.0.0" to clipboard
dispose_scope: ^1.0.0 copied to clipboard

Package reducing boiler related to disposing/canceling/closing objects.

example/main.dart

import 'dart:async';

import 'package:dispose_scope/dispose_scope.dart';

void main() {
  final disposeScope = DisposeScope();

  // StreamSubscription will be cancelled when disposeScope is disposed
  const Stream.empty().listen((event) {}).disposed(disposeScope);

  // Timer will be cancelled when disposeScope is disposed
  Timer(Duration.zero, () {}).disposed(disposeScope);

  disposeScope.dispose();
}
12
likes
130
pub points
75%
popularity

Publisher

verified publisherodrowaz.dev

Package reducing boiler related to disposing/canceling/closing objects.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on dispose_scope