dispose method
Marks the object as disposed and cleans up managed resources.
Implementation
Future<void> dispose() async {
if (_disposed) return;
_disposed = true;
await Future.wait([
..._managedControllers.map((c) async => await c.close()),
..._managedSubscriptions.map((s) async => await s.cancel()),
]);
}