0
  int timechanger = 10;
  Duration countDown = Duration(hours: timechanger);

I am trying to reduce the time with my current time So I have to give a time limit dynamically I have tried this but it shoes error

1 Answers1

2

Just put the static keyword in front of the timechanger.

 static int timechanger = 10;
 Duration countDown = Duration(hours: timechanger);
Kishan Busa
  • 691
  • 4
  • 13
  • No idea why this has two upvotes. `static` has the *side-effect* of solving this problem. You have no idea whether the OP wants this to be `static` or not... – nvoigt Apr 13 '22 at 08:11