Future.delayed(Duration(seconds: 2), () { // <-- Delay here setState(() { _isLoading = false; // <-- Code run after delay }); });