an_viewmodel 2.0.0 copy "an_viewmodel: ^2.0.0" to clipboard
an_viewmodel: ^2.0.0 copied to clipboard

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

2.0.0 #

  • 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.

1.0.0 #

  • Migrate from an_lifecycle_viewmodel.
3
likes
0
points
314
downloads

Publisher

verified publisheraymtools.com

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues

Topics

#viewmodel #view-model #viewmodels

License

unknown (license)

Dependencies

an_lifecycle_cancellable, anlifecycle, cancellable, flutter, weak_collections

More

Packages that depend on an_viewmodel