runWhenSleep property
runWhenSleep default is true
-- if true: onDurationRemainChanged will be called even when the phone turns off the screen
-- if false: onDurationRemainChanged will not be called when the phone turns off the screen
Note, whether you set runWhenSleep to true or false, when the app is reopened, the timer will still count the amount of time you turn off the screen, but it won't count if you call the controller.pause function.
Implementation
final bool runWhenSleep;