Skip to content

CreateTimerHandler typedef documentation errors #54177

@Hixie

Description

@Hixie

https://main-api.flutter.dev/flutter/dart-async/CreateTimerHandler.html

The custom handler can choose to replace the function f with one that does something before, after or instead of calling f, and then call parent.createTimer(zone, replacement). or it can implement its own timer queue, which typically still depends on parent.createTimer to as a way to get started.

Issues:

  • parent.createTimer takes three arguments, not two.

  • There's a stray period before "or it can implement".

  • It's not clear why you would call parent.createTimer (which takes a zone) vs self.createTimer. Indeed it's not really clear why there's three zones in play here. When you call runZoned, there's only two zones that you really should worry about: yours, and the new one.

Other documentation around the timer logic in zones is anemic at best. ZoneSpecification.createTimer is a single line, and doesn't mention that CreateTimerHandler has useful information. Zone.createTimer is empty documentation (just one line of text that you can guess from the names of the members), and doesn't point to anything useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-asynctype-documentationA request to add or improve documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions