Splash 頁面跳轉問題
使用
Navigator.pushNamedAndRemoveUntil(context, ’/home‘ , (_) => false);
表示跳轉到新頁面,並且清理之前 router 中的所有歷史頁面。
計時器
3s 後執行某段代碼:
Timer(Duration(seconds: 3), () {
print("Yeah, this line is printed after 3 seconds");
});
重複執行循環執行:
Timer.periodic(Duration(seconds: 5), (timer) {
print(DateTime.now());
});