GithubHelp home page GithubHelp logo

Comments (5)

Aturex1 avatar Aturex1 commented on August 30, 2024 2

It didn't work because of a logical error. I tested the minimum example above and it seemed to work properly. Closing this as a (logical) bug not of the package.
I'm sorry to have kept you in suspense with something so unnecessary.

from pausable_timer.

mateusfccp avatar mateusfccp commented on August 30, 2024

@Aturex1 How should it behave in this case? If the duration of the period is zero, the callback would in theory be called infinite times, which is obviously not what we want here.

from pausable_timer.

Aturex1 avatar Aturex1 commented on August 30, 2024

The callback should be called once (if the timer is not periodic). However, if it is a periodic timer it shouldn't be called.

from pausable_timer.

mateusfccp avatar mateusfccp commented on August 30, 2024

The callback should be called once (if the timer is not periodic). However, if it is a periodic timer it shouldn't be called.

So the issue is specifically for non-periodic timer. The behavior described seems to make sense. I am only worried if this is the same behavior as the dart:core's Timer, as we want to be consistent with it.

from pausable_timer.

mateusfccp avatar mateusfccp commented on August 30, 2024

I just tried the dart:core's behavior and this is definitely a bug. Even with a periodic timer it should work.

Indeed, even our documentation suggests that this should work:

/// The [duration] must be equals or bigger than [Duration.zero].
/// If it is [Duration.zero], the [callback] will still not be called until
/// the timer is [start]ed.

I don't know if this worked before or not. This may have been introduced in the latest refactor.

from pausable_timer.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.