From 3d9d15c5a0ed729d2a7f31a04c1687ba7954ce56 Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 9 Jan 2024 14:57:11 -0700 Subject: [PATCH] switch to context.pop() so we're going through the goRouter pkg as designed --- lib/ui/common/controls/circle_buttons.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ui/common/controls/circle_buttons.dart b/lib/ui/common/controls/circle_buttons.dart index 99c7384c..df752ed5 100644 --- a/lib/ui/common/controls/circle_buttons.dart +++ b/lib/ui/common/controls/circle_buttons.dart @@ -138,7 +138,11 @@ class BackBtn extends StatelessWidget { if (onPressed != null) { onPressed?.call(); } else { - Navigator.of(context).pop(); + if (context.canPop()) { + context.pop(); + } else { + context.go(ScreenPaths.home); + } } } }