LiteState<T extends LiteStateController> class
Constructors
-
LiteState({required LiteStateBuilder<T> builder, LiteStateController<T>? controller, ValueChanged<T>? onReady, bool isSliver = false, String? builderName, bool useIsolatedController = false, Key? key})
-
builder a function that will be called every time
you call rebuild in your controller
controller if you don't need a persistent controller
pass a new instance of controller here and it will be disposed
as soon as your LiteState widget is disposed
onReady this callback is guaranteed to be called after
LiteState has completed initialization and local storage
already can be used
builderName allows to build only a specific builder
for example, you have a view widgets wrapped in LiteState in the same page
if you pass a name to a lite state builder, you can then use it in this method
to rebuild a particular one. This might be very useful with complex UIs
const
Properties
-
builder
→ LiteStateBuilder<T>
-
final
-
builderName
→ String?
-
builderName allows to build only a specific builder
for example, you have a view widgets wrapped in LiteState in the same page
if you pass a name to a lite state builder, you can then use it in this method
to rebuild a particular one. This might be very useful with complex UIs.
final
-
controller
→ LiteStateController<T>?
-
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
isSliver
→ bool
-
final
-
key
→ Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onReady
→ ValueChanged<T>?
-
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
useIsolatedController
→ bool
-
useIsolatedController can be useful if you need to use the
same controller type for many widgets but the controller instances
must be different. In this case pass an instance of the controller and
set useIsolatedController to true. If it's set to true but a controller
is not provided, you will get an exception.
IMPORTANT: it it's set to true, then the controller is not available via
findController and cannot be disposed of manually. It's completely bound
to the instance of LiteState
final