I'm just starting to look at alternatives to setState()
and therefore Provider. In the first program that I am looking at to implement Provider, the only setState()
that I use is on the initial build()
, and also when data changes in order to display a FAB when the FAB is not already displayed. There are six TextField
widgets in this program, and they all have TextEditingControllers
, so they all have their own state.
Is it feasible to use Provider in this situation when _tfDataHasChanged (bool)
changes, and if so, how?
Code is below for the FAB creation:
Widget _createFab() {
if (_tfDisplayOnly || !_tfDataHasChanged) return null;
return FloatingActionButton(
onPressed: _btnSubmitPressed,
backgroundColor: _colorFab,
mini: false,
tooltip: _sBtnSubmitText /* Add or Create */,
child: _iconFab,
);
}