I have an array of small objects which is used to display List. What I'm doing now:
final _wordsList = <Word>[];
String triggerRerender;
getSharedText() async {
var sharedData = await platform.invokeMethod("getSharedText");
if (sharedData != null) {
_wordsList.add(Word(sharedData));
setState(() {
triggerRerender = sharedData;
});
}
}
and that feels wild. Shouldn't I be triggering rerender by changing array, not by some "trigger" primitive?