Привет, я хотел бы сделать условие, используя троицу внутри моего виджета ... но я не смог передать его ... ошибка говорит, что type '()=>Null' is not a subtype of type 'Widget'
, а вот код
DateFormat("HH:mm:ss").format(DateTime.now()) =="05:12:01"
?
// the error starts from here since I have 2 commands (setState and widget Text) inside function
() {
setState(() {
fail = true;
_imageFile = null;
});
Text('Time is up');
}
: Text("Success")
что я должен сделать, чтобы получить Text('Time is up');
и
setState(() {
fail = true;
_imageFile = null;
});
это плохая идея заключить его в функцию?