Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter delay a function

void main() async {
  print('Started at ${DateTime.now()}');
  final time = await Future.delayed(Duration(seconds: 2)).then((value) => DateTime.now());
  print('Awaited time was at $time');
}
Source by blog.logrocket.com #
 
PREVIOUS NEXT
Tagged: #flutter #delay #function
ADD COMMENT
Topic
Name
1+3 =