Control Object
The Control Object action is used to programmatically control various built-in controllers within your app—such as ScrollController
, TextEditingController
, PageController
, and more. This allows you to perform actions like scrolling to a specific position, clearing a text field, or changing a page index directly through interactions.
Use Cases
Programmatically scrolling to a widget.
Clearing or setting text in a
TextField
.Animating between pages in a
PageView
.Executing any supported method on a controller object dynamically.
Properties
dataType
(Required) The type of controller object to control (e.g., scrollController
, textFieldController
, pageController
). This is usually defined as an expression referencing a controller.
method
The method to call on the controller (e.g., jumpTo
, animateToPage
, clear
, setText
).
args
An object containing named arguments to be passed to the method. The keys and structure of this object depend on the method being called.
Default Behavior
No controller is invoked unless all required parameters (
dataType
,method
, and applicableargs
) are provided correctly.Execution depends on the availability of the controller in the runtime context.
The action dynamically reflects behavior based on the specific controller type and method.
How to Use
Attach the action to an interaction (e.g., button click).
Select Control Object from the action list.
Provide a
dataType
referencing the controller you want to act upon.Specify the
method
you want to call (such asjumpTo
orclear
).Provide any required
args
that the method expects.
Note: Ensure the controller is already initialized in your context or assigned to the target widget before calling this action.
Last updated