...

/

The Obx Widget

The Obx Widget

Learn to handle state changes from multiple controllers using Obx.

Overview

Obx is an extremely simple widget with a single purpose—to listen to changes in the controller. We don’t need to provide the controller type or initialize the controller. It even has the ability to listen to multiple controllers from a single widget.

However, this simplicity comes at a price. We cannot initialize or attach controllers to Obx. It does not provide any life cycle controls and is not responsible for disposing of the controllers.

Initializing controller

So, how do we initialize the controllers? By using dependency injection! We can use any of the dependency injection ...