0

Basically, I have a bunch of ListTiles on my home page which represents some timers. When I press a ListTile it navigator goes to another page with an option to set a timer and a cool clock animation. Now when I go back to the home page the animation and that complete page get disposed. but I want the timer to continue even if we close the page. Can I get a good suggestion to implement this idea?

enter image description here

enter image description here

void
  • 12,787
  • 3
  • 28
  • 42
Richard J
  • 80
  • 1
  • 4
  • 10

1 Answers1

1

In your stateful widget, include a mixin like this!

class _ClassNameState extends State<ClassName> with AutomaticKeepAliveClientMixin<Upload> {
//code
}
Abbas
  • 773
  • 6
  • 16
  • I don't understand how AutomaticKeepAliveClientMixin works. I tried including it as you said, but no luck. – Richard J May 07 '20 at 03:45