ReactterProviders
The ReactterProviders
widget is a container for multiple providers that allows you to provide multiple dependencies to the widget tree.
Syntax
Properties
providers
: A list ofReactterProvider
widgets that are to be wrapped by theReactterProviders
.key
: An optionalKey
to use for identifying the widget.child
: An optionalWidget
which is independent of theReactterProviders
. If defined, it is passed to thebuilder
function if it is defined.-
builder
: An optional function which builds a widget depending on theReactterProviders
. If it not defined, thechild
widget is returned. It receives the following arguments:context
: TheBuildContext
of the widget. A handle to the location ofReactterProviders
in the widget tree.child
: Thechild
widget passed to theReactterProviders
widget.
Example
In the following example, we have a simple counter application that uses the ReactterProviders
widget to provide multiple dependencies to the widget tree.