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

Property
Description

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 applicable args) 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

  1. Attach the action to an interaction (e.g., button click).

  2. Select Control Object from the action list.

  3. Provide a dataType referencing the controller you want to act upon.

  4. Specify the method you want to call (such as jumpTo or clear).

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