diff --git a/lib/settings_page.dart b/lib/settings_page.dart index 08281f2..cdb7386 100644 --- a/lib/settings_page.dart +++ b/lib/settings_page.dart @@ -546,25 +546,32 @@ class _SettingsPageState extends State { Widget SettingsMain(Color primary, Map? settings, Function updatePage, Function goBack, Color back, Image image, context, colors, allColors) { - return Material( - color: colors[0], - child: CustomScrollView( - slivers: [ - SliverAppBar.large( - leading: - IconButton(icon: Icon(Icons.arrow_back, color: colors[0],), onPressed: () { - HapticFeedback.selectionClick(); - goBack(); - }), - title: comfortatext(translation('Settings', settings!["Language"]!), 30, settings, color: colors[0]), - backgroundColor: colors[1], - pinned: false, - ), - // Just some content big enough to have something to scroll. - SliverToBoxAdapter( - child: NewSettings(settings, updatePage, image, colors, allColors, context), - ), - ], + return PopScope( + canPop: false, + onPopInvoked: (bool didPop) async { + goBack(); + }, + child: Material( + color: colors[0], + child: CustomScrollView( + slivers: [ + SliverAppBar.large( + leading: + IconButton(icon: Icon(Icons.arrow_back, color: colors[0],), + onPressed: () { + HapticFeedback.selectionClick(); + goBack(); + }), + title: comfortatext(translation('Settings', settings!["Language"]!), 30, settings, color: colors[0]), + backgroundColor: colors[1], + pinned: false, + ), + // Just some content big enough to have something to scroll. + SliverToBoxAdapter( + child: NewSettings(settings, updatePage, image, colors, allColors, context), + ), + ], + ), ), ); }