disposable_object

Creator: coderz1093

Last updated:

0 purchases

disposable_object Image
disposable_object Images

Languages

Categories

Add to Cart

Description:

disposable object

disposable #
A simple interface to manage disposable objects, their disposal and check their disposed status.
Getting Started #
Just make your disposable object extend Disposable and implement the disposeInstance override!
Example #
import 'dart:async';

import 'package:disposable/disposable.dart';

class MyDisposableObject extends Disposable {
final streamController = StreamController.broadcast();
@override
void disposeInstance() {
streamController.close();
}
}

void main() {
final object = MyDisposableObject();
print('Stream closed: ${object.streamController.isClosed}');
print('Object disposed: ${object.disposed}');

object.dispose();

print('Stream closed: ${object.streamController.isClosed}');
print('Object disposed: ${object.disposed}');
}

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.