showTimer method
Implementation
Widget showTimer() {
return ValueListenableBuilder<int?>(
valueListenable: _counterTimer,
builder: (context, countTimer, _) {
return countTimer != 0
? Positioned(
top: 20,
left: 0,
right: 0,
child: Center(
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
transitionBuilder: (child, animation) {
return ScaleTransition(
scale: animation,
child: child,
);
},
child: Text(
"$countTimer",
style: const TextStyle(
fontSize: 100.0,
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
),
),
)
: const SizedBox();
},
);
}