pikapika/lib/screens/SettingsScreen.dart

110 lines
3.9 KiB
Dart
Raw Permalink Normal View History

2021-10-16 17:17:06 +00:00
import 'dart:io';
2021-09-29 23:57:09 +00:00
import 'package:flutter/material.dart';
2021-11-11 03:00:38 +00:00
import 'package:pikapika/basic/Common.dart';
import 'package:pikapika/basic/config/AndroidDisplayMode.dart';
import 'package:pikapika/basic/config/AndroidSecureFlag.dart';
import 'package:pikapika/basic/config/AutoClean.dart';
import 'package:pikapika/basic/config/AutoFullScreen.dart';
import 'package:pikapika/basic/config/ChooserRoot.dart';
import 'package:pikapika/basic/config/ContentFailedReloadAction.dart';
import 'package:pikapika/basic/config/ConvertToPNG.dart';
import 'package:pikapika/basic/config/DownloadAndExportPath.dart';
import 'package:pikapika/basic/config/DownloadThreadCount.dart';
import 'package:pikapika/basic/config/FullScreenAction.dart';
import 'package:pikapika/basic/config/FullScreenUI.dart';
import 'package:pikapika/basic/config/KeyboardController.dart';
2021-11-21 13:18:23 +00:00
import 'package:pikapika/basic/config/NoAnimation.dart';
2021-11-11 03:00:38 +00:00
import 'package:pikapika/basic/config/PagerAction.dart';
import 'package:pikapika/basic/config/ReaderDirection.dart';
2021-12-09 00:08:01 +00:00
import 'package:pikapika/basic/config/ReaderSliderPosition.dart';
2021-11-11 03:00:38 +00:00
import 'package:pikapika/basic/config/ReaderType.dart';
import 'package:pikapika/basic/config/Quality.dart';
import 'package:pikapika/basic/config/ShadowCategories.dart';
import 'package:pikapika/basic/config/Themes.dart';
import 'package:pikapika/basic/config/TimeOffsetHour.dart';
2021-11-11 09:05:48 +00:00
import 'package:pikapika/basic/config/Version.dart';
2021-11-11 03:00:38 +00:00
import 'package:pikapika/basic/config/VolumeController.dart';
2021-11-24 13:22:22 +00:00
import 'package:pikapika/basic/config/shadowCategoriesMode.dart';
2021-11-11 03:00:38 +00:00
import 'package:pikapika/screens/components/NetworkSetting.dart';
2021-09-29 23:57:09 +00:00
import 'CleanScreen.dart';
2021-10-18 09:31:05 +00:00
import 'MigrateScreen.dart';
2021-09-29 23:57:09 +00:00
2021-11-04 03:45:22 +00:00
class SettingsScreen extends StatelessWidget {
2021-09-29 23:57:09 +00:00
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: Text('设置')),
body: ListView(
children: [
Divider(),
NetworkSetting(),
Divider(),
2021-10-21 04:08:51 +00:00
qualitySetting(),
2021-11-06 11:25:44 +00:00
convertToPNGSetting(),
2021-11-04 03:45:22 +00:00
readerTypeSetting(),
readerDirectionSetting(),
2021-12-09 00:08:01 +00:00
readerSliderPositionSetting(),
2021-11-04 03:45:22 +00:00
autoFullScreenSetting(),
fullScreenActionSetting(),
2021-10-13 13:57:35 +00:00
volumeControllerSetting(),
keyboardControllerSetting(),
2021-11-29 03:26:30 +00:00
noAnimationSetting(),
2021-09-29 23:57:09 +00:00
Divider(),
2021-11-24 13:22:22 +00:00
shadowCategoriesModeSetting(),
2021-10-21 04:08:51 +00:00
shadowCategoriesSetting(),
2021-11-04 03:45:22 +00:00
pagerActionSetting(),
fullScreenUISetting(),
contentFailedReloadActionSetting(),
timeZoneSetting(),
2021-09-29 23:57:09 +00:00
Divider(),
2021-11-04 03:45:22 +00:00
autoCleanSecSetting(),
2021-09-29 23:57:09 +00:00
ListTile(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => CleanScreen()),
);
},
title: Text('清除缓存'),
),
Divider(),
2021-10-13 13:57:35 +00:00
androidDisplayModeSetting(),
2021-10-29 03:38:36 +00:00
androidSecureFlagSetting(),
2021-09-29 23:57:09 +00:00
Divider(),
2021-11-04 03:45:22 +00:00
chooserRootSetting(),
2021-10-31 06:01:19 +00:00
downloadThreadCountSetting(),
2021-10-25 11:27:38 +00:00
downloadAndExportPathSetting(),
2021-10-15 06:18:29 +00:00
fontSetting(),
2021-10-07 03:47:28 +00:00
Divider(),
2021-11-04 03:45:22 +00:00
migrate(context),
2021-11-11 09:05:48 +00:00
Divider(),
autoUpdateCheckSetting(),
Divider(),
2021-09-29 23:57:09 +00:00
],
),
);
2021-10-16 17:17:06 +00:00
2021-11-04 03:45:22 +00:00
Widget migrate(BuildContext context) {
2021-10-16 17:17:06 +00:00
if (Platform.isAndroid) {
return ListTile(
title: Text("文件迁移"),
subtitle: Text("更换您的数据文件夹"),
onTap: () async {
2021-11-04 03:45:22 +00:00
var f =
await confirmDialog(context, "文件迁移", "此功能菜单保存后, 需要重启程序, 您确认吗");
2021-10-18 09:31:05 +00:00
if (f) {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(builder: (BuildContext context) {
return MigrateScreen();
}),
(route) => false,
);
}
2021-10-16 17:17:06 +00:00
},
);
}
return Container();
}
2021-09-29 23:57:09 +00:00
}