disposito 1.0.1 copy "disposito: ^1.0.1" to clipboard
disposito: ^1.0.1 copied to clipboard

Analyzer plugin for object lifetimes: fields annotated with @Disposable must be cleaned up by the class that declares them, objects that own a lifecycle must not be created during a Flutter build, and [...]

Changelog #

1.0.1 #

Lowers the minimum Dart SDK from 3.13.2 to 3.11.0. Nothing else changed: every dependency already resolved on 3.11, so the old constraint kept consumers off earlier stable SDKs for no reason.

1.0.0 #

This release replaces the package. Up to 0.2.3 disposito was a runtime disposal library: DisposeHolder, DisposeHolderHostMixin, and cleanup triggered when the owning object was garbage collected. From 1.0.0 it is an analyzer plugin instead, which catches a missing dispose at author time rather than running one for you at runtime.

The two share a subject and nothing else, so 1.0.0 has no API in common with 0.2.3. Nothing is deprecated, because nothing carried over: DisposeHolder, DisposeHolderHostMixin, Disposable, Closable, Cancelable, the binding extensions and DisposeRegistry are all gone.

  • If you use the runtime library, pin disposito: ^0.2.3. That code is unchanged on pub.dev and preserved on the runtime-library-v0.2.3 branch.
  • If you want the lints, take ^1.0.0 and read the installation section in the README: the package is now listed both as a dependency (for the @Disposable annotation) and as an analyzer plugin (for the rules).

What 1.0.0 contains, moved here from arxdeus_lints:

  • The @Disposable annotation.
  • missing_dispose, which reports an annotated field that the declaring class never cleans up, together with the quick fix that writes the cleanup call into the class's disposal method, creating that method when there is none.
  • stateful_in_build, which reports an object that owns a lifecycle being created during a Flutter build, where it is thrown away and replaced on every rebuild.
  • this_in_dispose, which reports a State handing out a reference to itself from its own dispose.
  • late_initialized_in_dispose, which reports a late field of a State whose initializer needs the state object and which nothing reads before dispose, so it is constructed during teardown.

Changelog #

0.2.3 - 2025-05-18 #

Documentation #

  • add comprehensive doc comments for classes (#9) - (6960ec7)
  • README v2 - (a0b8747)

Ci #

  • trigger dry publish on edit and synchronized - (673d6ec)

0.2.2 - 2025-03-23 #

Documentation #

  • (README) misspelling and styling fixes - (070b570)
  • (dispose_holder_mixin) internal comment for debugName clarification - (8aa2613)

Miscellaneous Chores #

  • (example) oneline dispose in simple.dart - (0343a30)
  • (internal) more verbose internal class names - (e41fb98)

Refactoring #

  • (dispose_holder) migrate to asynchronous api under the hood - (c5892ec)
  • (dispose_registry) execute function in purgeAfter synchronously - (07a965f)
  • (extensions) asynchronous api without unawaited - (28a7d31)
  • (internal) Callable.call static for tear-off callback execution - (15324e6)

Ci #

  • (dry_publish) fix double dry-run - (6efd6c7)

0.2.1 - 2025-03-21 #

Documentation #

  • (README) fix typos and misspellings - (e149ae0)

Ci #

  • fix release condition - (2579ac4)

0.2.0 - 2025-03-21 #

Bug Fixes #

  • (dispose_holder) make dispose async - (4489a13)
  • (example) update to new syntax - (4f993ff)
  • (extensions) update extensions to new syntax - (11f03a4)
  • path to wrapper inside internal.dart - (f443f00)
  • remove createDisposable and DisposeWrapper - (a3fe6e4)

Documentation #

Features #

  • (disposable) static disposeObject proxies FutureOr<void> instead of void - (868ce56)
  • (dispose_holder) rethink of prioritization of dispose queue - (cbb0832)
  • (dispose_registry) rethink of prioritization of purge callback - (156dc4c)
  • (example) simple example - (ed12719)
  • (example) simple now have async callback and disposes - (a34805e)

Miscellaneous Chores #

  • (dispose_holder) update naming of methods - (0ae1aec)
  • (extensions) change variable input name - (b4c4247)
  • (internal) disposable wrapper implements disposable - (5443887)

Tests #

Ci #

  • missing PAT + change versions strategy - (7bc5260)

0.1.0 - 2025-03-19 #

Bug Fixes #

  • (extensions) change signatures to generics to allow subtypes - (2e2759c)

Features #

  • (dispose_tracker) dispose tracker as public global interactor - (2e03b79)
  • (dispose_tracker) purge on create/dispose each other holder - (f38e5c9)
  • [BREAKING CHANGE] disposito main logic - (ca1db16)

Miscellaneous Chores #

  • (disposable) static method for tear-off - (2ebea5b)
  • (pubspec) update description - (a200d5e)

Refactoring #

  • code style + lint matching - (bf533bb)

Tests #

Ci #

  • wrong step variable name - (d329299)
  • fix double slash on pr create - (322b10f)

0.0.1 #

  • Initial version.
4
likes
150
points
86
downloads

Documentation

API reference

Publisher

verified publisherarxdeus.dev

Weekly Downloads

Analyzer plugin for object lifetimes: fields annotated with @Disposable must be cleaned up by the class that declares them, objects that own a lifecycle must not be created during a Flutter build, and a State must not hand itself out of its own dispose or build a late field during teardown.

Repository (GitHub)
View/report issues

Topics

#analyzer-plugin #lints #static-analysis #memory

Funding

Consider supporting this project:

ko-fi.com

License

MIT (license)

Dependencies

analysis_server_plugin, analyzer, analyzer_plugin, analyzer_plugin_toolkit

More

Packages that depend on disposito