PackageTrack
Sign in Get early access

an_viewmodel

A package for managing ViewModel that depends on anlifecycle. Similar to Androidx ViewModel.

3.8.0 aymtools/an_viewmodel

What this package is like to depend on

Last release 15 days ago

09 Aug 2026

Release timing varies

gaps range from 1 weeks to 4 months

Nearly every release is documented

notes for 22 of 22 stable releases

Nothing withdrawn

no release was ever pulled

2 years old

24 releases · first in 2024

8 releases in the last 12 months

see the full history below

Release timeline

24 releases · Nov 2024 to Aug 2026
2025 2026
Release Pre-release

Releases

latest 24
  1. 3.8.0 09 Aug 2026
    Release notes
    • ViewModel.useHostLifecycle now supports custom onCleared state handling.
    • Deprecated: Marked the onCreate lifecycle method as deprecated due to naming ambiguity ( users frequently confused whether the ViewModel was actively creating or already created). It will be completely removed in a future major release.
    • Migration Guide: Please migrate your initialization logic from onCreate to the newly introduced onCreated method.
    Open source →
  2. 3.7.0 04 Apr 2026
    Release notes
    • Added ViewModelCallbacks to observe the ViewModel lifecycle.
    Open source →
  3. 3.6.0 28 Dec 2025
    Release notes
    Open source →
  4. 3.6.0-pre.1 17 Dec 2025 pre-release

    Nothing published for this version

  5. 3.5.1 01 Nov 2025
    Release notes
    • Update readme.
    Open source →
  6. 3.5.0 27 Sep 2025
    Release notes
    • Added ViewModel.useHostLifecycle
    Open source →
  7. 3.4.1 11 Sep 2025
    Release notes
    • Code standardization
    Open source →
  8. 3.4.0 07 Sep 2025
    Release notes
    • Optimize the search efficiency of ViewModelProvider
    Open source →
  9. 3.3.0 19 Aug 2025
    Release notes
    • Added support for specifying the type during creation to enable runtime ViewModel instantiation.
    • ViewModelProvider.getOrCreate is deprecated, please use getOrCreateViewModel instead.

    Breaking Changes

    • All ViewModel functions in ViewModelStore now have an optional vmType parameter.
    Open source →
  10. 3.2.1 03 Aug 2025
    Release notes

    优化_MergingValueNotifier的清理时机

    Open source →
    Release notes
    • Optimize the cleanup timing of _MergingValueNotifier.
    Open source →
  11. 3.2.0 06 Jul 2025
    Release notes
    • Upgrading Dependencies.
    Open source →
  12. 3.1.0 03 Jun 2025
    Release notes
    • RefViewModelProvider now supports handling viewModelStore removal.
    Open source →
  13. 3.0.3 01 Jun 2025
    Release notes
    • Fix the bug in the ViewModel extension viewModels.
    Open source →
  14. 3.0.2 20 May 2025
    Release notes
    • Fix the bug when viewModelProviderProducer is null.
    Open source →
  15. 3.0.1 15 May 2025
    Release notes
    • Adjust example
    Open source →
  16. 3.0.0 15 May 2025
    Release notes
    • Add onCreate method to ViewModel, called after the ViewModel is created.
    • Add a viewModels extension method in ViewModel to retrieve ViewModels stored at the same level or higher levels.
    • Add to remember the ViewModelProviderProducer when creating the ViewModel, ensuring the same behavior for subsequent automatic creations.
    • ViewModel.doNotAssertProviderProducer is used for compatibility when upgrading from v2 to v3, to prevent asserting and checking the validity of the ProviderProducer.

    Breaking Changes

    • Change ViewModelProvider.get to getOrCreate
    Open source →
  17. 2.1.4 01 Apr 2025
    Release notes
    • Fix the bug of clearing the ViewModel when removing from ViewModelStore.
    Open source →
  18. 2.1.3 06 Mar 2025
    Release notes
    • Print logs for ViewModel creation and cleanup in non-release mode.
    Open source →
  19. 2.1.2 06 Mar 2025
    Release notes
    • Upgrading Dependencies.
    Open source →
  20. 2.1.1 26 Feb 2025
    Release notes
    • Add more proactive notifications to valueNotifierStreamXXX when notifyWhenEquals=true.
    Open source →
  21. 2.1.0 23 Feb 2025
    Release notes
    • BuildContext.withLifecycleAndViewModelEffect allows executing lifecycle-related functions based on the current context and ViewModel.
    • Optimize the usage of ViewModelProviderProducer.
    Open source →
  22. 2.0.0 08 Feb 2025
    Release notes
    • Added makeCloseable to provide cancelable based on viewmodel lifecycle.
    • ViewModel adds extensions: valueNotifier, valueNotifierAsync, valueNotifierStream, valueNotifierAsyncStream, valueNotifierFuture, valueNotifierAsyncFuture, valueNotifierStreamController, valueNotifierAsyncStreamController, valueNotifierTransform, valueNotifierMerge to facilitate the rapid construction of ValueNotifiers.

    Breaking Changes

    • viewModels(factory,factory2) : Parameters factory and factory2 are no longer automatically added to ViewModelProvider to prevent memory leaks.
    • RefViewModelProvider is no longer a subclass of ViewModel.
    • viewModelsByRef(factory2) : The lifecycle parameter of factory2 is changed to AppLifecycle.
    • ViewModelStore : The key in ViewModelStore has been adjusted to its type.
    Open source →
  23. 2.0.0-dev.1 18 Jan 2025 pre-release

    Nothing published for this version

  24. 1.0.0 11 Nov 2024
    Release notes
    • Migrate from an_lifecycle_viewmodel.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive