> For the complete documentation index, see [llms.txt](https://meulencv.gitbook.io/flutter-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://meulencv.gitbook.io/flutter-documentation/widgets/valuelistenablebuilder.md).

# ValueListenableBuilder

Like set state, it changes a widget every time a variable is updated

First, we will declare a variable of type `ValueNotifier` which is a special type of class.

```dart
ValueNotifier<int> _counter = ValueNotifier<int>(0);
```

Now in the next step let’s see the widget code.

```dart
ValueListenableBuilder(
    valueListenable: _counter,
    builder: (context, value, child) {
       return Text('$value', style: Theme.of(context).textTheme.headline4,);
    },
)
```

To update the variable, you can do:

<pre class="language-dart"><code class="lang-dart"><strong>_varIndex.value++;
</strong></code></pre>
