valueListenable property
get value listenable
same as widget's onChanged , but it is more useful when you want to build a widget relies on field's value change
eg: if you want to build a clear icon on textField , but don't want to display it when textField's value is empty ,you can do like this :
return ValueListenableBuilder<String?>(
valueListenable:formeKey.valueField(name).valueListenable,
builder: (context, a, b) {
return a == null || a.length == 0
? SizedBox()
: IconButton(icon:Icon(Icons.clear),onPressed:(){
formeKey.valueField(name).value = '';
});
});
this notifier is used for ValueListenableBuilder
Implementation
@override
ValueListenable<T> get valueListenable => _delegate.valueListenable;