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

Vasanthan Raj
  • 126
  • 1
  • 9

1 Answers1

2

Just put the static keyword in front of the timechanger.

 static int timechanger = 10;
 Duration countDown = Duration(hours: timechanger);
Kishan Busa
  • 821
  • 6
  • 14
  • 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