skip to Main Content

Flutter – Why does not "await" work in async method?

Why does not "await" work? Future<void> f1() async{ Future.delayed(Duration(seconds:2), (){ print('f1'); }); } void main() async{ print('start'); await f1(); print('end'); } output start end f1 but await working in next code. Future<void> f1() async{ return Future.delayed(Duration(seconds:2), (){ print('f1'); }); }…

VIEW QUESTION

Reactjs – React async doesn't trigger rerender

const AUTH_DISABLED = 0; const AUTH_LOGIN = 1; const AUTH_LOGOUT = 2; function App() { const [showLoginPopup, setShowLoginPopup] = useState(false); const [authButtonState, setAuthButtonState] = useState(AUTH_DISABLED); const handleClick = () => { if ( authButtonState == AUTH_LOGOUT ) { authGlobal.logout().then( ()…

VIEW QUESTION
Back To Top
Search