I realised that in current Dart SDK version 0.4.1.0_r19425 methods like setTimeout
, setInterval
, clearTimeout
, clearInterval
aren't part of Window
class any more and they all moved to WorkerContext
.
Is there any documentation on how to use them now? Do I need to create a new instance of WorkerContext
every time I want to use them?
相关问题
- What means in Dart static type and why it differs
- Flutter : Prepare list data from http request
- How to schedule an alarm on specific time in Flutt
- MappedListIterable is not a SubType
- What is the difference between generics and dynami
相关文章
- Observatory server failed to start - Fails to crea
- Adding Shadows at the bottom of a container in flu
- Flutter. Check if a file exists before loading it
- Receive share file intents with Flutter
- Do stateless widgets dispose on their own?
- how to implement Alphabet scroll in flutter
- Flutter: Is it possible to format (bold, italicize
- Make Function parameter optional in custom widget
You can use:
1) SetInterval
2) SetTimeOut
From this post on the group (Feb 14th 2013).
And another example (copied from the same post)
Specifically, they are now part of the
Timer
class in thedart:async
library (rather thanWorkerContext
, which seems to be IndexedDb specific). API docs hereIn addition to Timer mentioned by Chris, there is a Future-based API:
There is not yet direct support for cancelling a Future callback, but this works pretty well:
Hopefully, there will soon be a Stream version of Timer.repeating as well.