feat: add configurable main page back behavior (#870)

* feat: add configurable main page back behavior

Add setting to control whether back button exits directly or returns to first tab

* update

---------

Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
6v
2025-06-26 11:40:44 +08:00
committed by GitHub
parent 0264a4c01f
commit 7886a901a3
5 changed files with 33 additions and 8 deletions

View File

@@ -623,6 +623,17 @@ List<SettingsModel> get styleSettings => [
subtitle: '删除或调换Navbar',
leading: const Icon(Icons.toc_outlined),
),
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '返回时直接退出',
subtitle: '开启后在主页任意tab按返回键都直接退出关闭则先回到Navbar的第一个tab',
leading: const Icon(Icons.exit_to_app_outlined),
setKey: SettingBoxKey.directExitOnBack,
defaultVal: false,
onChanged: (value) {
Get.find<MainController>().directExitOnBack = value;
},
),
if (Platform.isAndroid)
SettingsModel(
settingsType: SettingsType.normal,