ViewModelProvider<T extends ViewModel> class

(Deprecated) Use ViewModelSpec instead.

Inheritance
Annotations

Constructors

ViewModelProvider({required T builder(), Object? key, Object? tag, bool aliveForever = false})

Properties

builder → T Function()
finalinherited
debugSource → Object
Stable source identity used by debug collision diagnostics.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

aliveForever() → bool
Returns true to keep the instance alive when no bindings remain.
inherited
build() → T
Creates and returns a new instance of the ViewModel.
inherited
clearProxy() → void
Clears the legacy global proxy without disturbing scoped overrides.
inherited
key() → Object?
Returns an explicit key for identifying ViewModel instances.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideWith(ViewModelSpec<T> spec) → void Function()
Overrides this spec until the returned restore callback is invoked.
inherited
runWithOverride<R>(ViewModelSpec<T> spec, FutureOr<R> body()) → Future<R>
Runs body with spec installed, then always restores the prior proxy.
inherited
setProxy(ViewModelSpec<T> spec) → void
Installs the legacy global proxy used when no scoped override is active.
inherited
singleton() → bool
(Deprecated) Returns true if this factory should create singleton instances. Use key instead.
inherited
tag() → Object?
Returns a tag to identify or categorize this ViewModel.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited