A package timer works correctly even if the app is locked issue
Scaffold(
body: Center(
child: CountDownWidget(
duration: Duration(seconds: 20),
builder: (context, duration) {
return Text(duration.inSeconds.toString());
},
onDurationRemainChanged: (duration) {
print('duration:${duration.toString()}');
},
),
),
)