2019 edition:
In Async Code
await Future.delayed(Duration(seconds: 1));
In Sync Code
import 'dart:io';
sleep(Duration(seconds:1));
Note: This blocks the entire process (isolate), so other async functions will not be processed. It's also not available on the web because Javascript is really async-only.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…