I want to show a Text()
widget in the first second of ConnectionState.waiting
, but if it takes longer than a second, I want to show a different Widget with a custom Animation.
Simplified code (StatelessWidget):
...
Stream
...
if (snapshot.connectionState == ConnectionState.waiting) {
return Text('Loading data');
return CustomWidget(); <- Show this widget instead of Text if more than 1 sec
}