docs+feat: add Disposable interface source and usage example

feat(core,doc): unified async dispose mechanism for resource cleanup

BREAKING CHANGE:

- Added full support for asynchronous resource cleanup via a unified FutureOr<void> dispose() method in the Disposable interface.
- The Scope now provides only Future<void> dispose() for disposing all tracked resources and child scopes (sync-only dispose() was removed).
- All calls to cleanup in code and tests (scope itself, subscopes, and custom modules) now require await ...dispose().
- Documentation and all examples updated: resource management is always async and must be awaited; Disposable implementers may use both sync and async cleanup.
- Old-style, synchronous cleanup methods have been completely removed (API is now consistently async for all DI lifecycle management).
- Example and tutorial code now demonstrate async resource disposal patterns.
This commit is contained in:
Sergey Penkovsky
2025-08-01 15:07:12 +03:00
parent 61f2268d63
commit a9c95f6a89
14 changed files with 516 additions and 69 deletions

View File

@@ -127,7 +127,7 @@ packages:
path: "../../cherrypick"
relative: true
source: path
version: "3.0.0-dev.3"
version: "3.0.0-dev.5"
cherrypick_annotations:
dependency: "direct main"
description:
@@ -141,7 +141,7 @@ packages:
path: "../../cherrypick_flutter"
relative: true
source: path
version: "1.1.3-dev.3"
version: "1.1.3-dev.5"
cherrypick_generator:
dependency: "direct dev"
description: