@@ -30,7 +30,7 @@ const String sessionSavePrefix = "session:";
3030class TimerPage extends StatefulWidget {
3131 final Tea tea;
3232
33- const TimerPage ({Key ? key, required this .tea}) : super (key : key );
33+ const TimerPage ({super . key, required this .tea});
3434
3535 @override
3636 TimerPageState createState () => TimerPageState ();
@@ -253,7 +253,7 @@ class TimerPageState extends State<TimerPage>
253253 }
254254 if (! kIsWeb) {
255255 FlutterVolumeController .getVolume ().then ((value) {
256- if (value == 0 ) {
256+ if (value == 0 && mounted ) {
257257 ScaffoldMessenger .of (context).showSnackBar (
258258 const SnackBar (
259259 content: Text ("Device is muted and won't ring!" ),
@@ -285,7 +285,7 @@ class TimerPageState extends State<TimerPage>
285285 });
286286 }
287287
288- Future <void > _onPopInvoked (bool didPop) async {
288+ Future <void > _onPopInvoked (bool didPop, dynamic result ) async {
289289 // confirm cancelling infusion if going back to collection page
290290 if (didPop) {
291291 return ;
@@ -313,7 +313,7 @@ class TimerPageState extends State<TimerPage>
313313 );
314314 },
315315 );
316- if ((shouldDiscard ?? false ) && context. mounted) {
316+ if ((shouldDiscard ?? false ) && mounted) {
317317 Navigator .pop (context);
318318 }
319319 }
@@ -344,7 +344,7 @@ class TimerPageState extends State<TimerPage>
344344 return PopScope (
345345 canPop:
346346 _animationController.isCompleted || _animationController.value == 0 ,
347- onPopInvoked : _onPopInvoked,
347+ onPopInvokedWithResult : _onPopInvoked,
348348 child: Scaffold (
349349 appBar: AppBar (title: const Text ("Tea Timer" )),
350350 body: Align (
@@ -423,7 +423,7 @@ class TimerPageState extends State<TimerPage>
423423 return Icons .play_arrow;
424424 }
425425 }()),
426- color: Colors .white.withOpacity ( 0.5 ),
426+ color: Colors .white.withValues (alpha : 0.5 ),
427427 onPressed: _startPauseNext,
428428 iconSize: progressIndicatorDiameter * 0.65 ,
429429 ),
0 commit comments