Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change format of timer #26

Open
behlsoft opened this issue Sep 1, 2021 · 1 comment
Open

Change format of timer #26

behlsoft opened this issue Sep 1, 2021 · 1 comment
Assignees

Comments

@behlsoft
Copy link

behlsoft commented Sep 1, 2021

It will be great if we can have way to choose which format we want for example I want timer to be always shown in 00:00 format example 10:00, 09:00, 00:09.

@WiRight
Copy link
Member

WiRight commented Sep 9, 2021

Hi!
You mean something about default builder function and setting only new format param?

See example below, I'm not explaining it well

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Countdown(
      seconds: 20,
      // build: (BuildContext context, double time) => Text(time.toString()),
      format: DateFormat.ABBR_MONTH, // Use only this 
      interval: Duration(milliseconds: 100),
      onFinished: () {
        print('Timer is done!');
      },
    );
  }
}

In simple way in builder function you may doing all you want with time argument)

@WiRight WiRight self-assigned this Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants