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

Access to current time outside from widget? #35

Open
tpc-justin opened this issue Oct 10, 2022 · 2 comments
Open

Access to current time outside from widget? #35

tpc-justin opened this issue Oct 10, 2022 · 2 comments

Comments

@tpc-justin
Copy link

hi DizoftTeam,

Congratulations first! Simple widget, self explaining and works great!

Is it possible to access current times outside of widget?

The example only shows how to access the time inside the widget:

build: (BuildContext context, double time) => Text(time.toString()),

I would have expected this to be via _controller, unfortunately I don't see a property time!?

Thanks
pc-Justin

@tpc-justin
Copy link
Author

I have figured it out but ask for confirmation.

double cur_time = 0;
.
.
.
 build: (BuildContext context, double time) {
cur_time = time;
return Text(time.toString(), style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.w600));
},

Thanks

@WiRight
Copy link
Member

WiRight commented Nov 1, 2023

Hey! Thank you for your issue!

Yes, I will add this functionality.

Maybe you can make a fix and pr?

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