136 lines
4.8 KiB
Dart
136 lines
4.8 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
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/DownloadAndExportPath.dart';
|
|
import 'package:pikapika/basic/config/DownloadThreadCount.dart';
|
|
import 'package:pikapika/basic/config/ExportRename.dart';
|
|
import 'package:pikapika/basic/config/FullScreenAction.dart';
|
|
import 'package:pikapika/basic/config/FullScreenUI.dart';
|
|
import 'package:pikapika/basic/config/KeyboardController.dart';
|
|
import 'package:pikapika/basic/config/NoAnimation.dart';
|
|
import 'package:pikapika/basic/config/PagerAction.dart';
|
|
import 'package:pikapika/basic/config/Quality.dart';
|
|
import 'package:pikapika/basic/config/ReaderDirection.dart';
|
|
import 'package:pikapika/basic/config/ReaderSliderPosition.dart';
|
|
import 'package:pikapika/basic/config/ReaderType.dart';
|
|
import 'package:pikapika/basic/config/ShadowCategories.dart';
|
|
import 'package:pikapika/basic/config/Themes.dart';
|
|
import 'package:pikapika/basic/config/TimeOffsetHour.dart';
|
|
import 'package:pikapika/basic/config/Version.dart';
|
|
import 'package:pikapika/basic/config/VolumeController.dart';
|
|
import 'package:pikapika/basic/config/shadowCategoriesMode.dart';
|
|
import 'package:pikapika/screens/components/NetworkSetting.dart';
|
|
import 'package:pikapika/screens/components/RightClickPop.dart';
|
|
|
|
import '../basic/config/UsingRightClickPop.dart';
|
|
import 'CleanScreen.dart';
|
|
import 'MigrateScreen.dart';
|
|
import 'ModifyPasswordScreen.dart';
|
|
|
|
class SettingsScreen extends StatelessWidget {
|
|
const SettingsScreen({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return rightClickPop(
|
|
child: buildScreen(context),
|
|
context: context,
|
|
canPop: true,
|
|
);
|
|
}
|
|
|
|
Widget buildScreen(BuildContext context) => Scaffold(
|
|
appBar: AppBar(title: const Text('设置')),
|
|
body: ListView(
|
|
children: [
|
|
const Divider(),
|
|
ListTile(
|
|
onTap: () async {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => const ModifyPasswordScreen()),
|
|
);
|
|
},
|
|
title: const Text('修改密码'),
|
|
),
|
|
const Divider(),
|
|
const NetworkSetting(),
|
|
const Divider(),
|
|
qualitySetting(),
|
|
readerTypeSetting(),
|
|
readerDirectionSetting(),
|
|
readerSliderPositionSetting(),
|
|
autoFullScreenSetting(),
|
|
fullScreenActionSetting(),
|
|
volumeControllerSetting(),
|
|
keyboardControllerSetting(),
|
|
noAnimationSetting(),
|
|
const Divider(),
|
|
shadowCategoriesModeSetting(),
|
|
shadowCategoriesSetting(),
|
|
pagerActionSetting(),
|
|
fullScreenUISetting(),
|
|
contentFailedReloadActionSetting(),
|
|
timeZoneSetting(),
|
|
const Divider(),
|
|
autoCleanSecSetting(),
|
|
ListTile(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (context) => const CleanScreen()),
|
|
);
|
|
},
|
|
title: const Text('清除缓存'),
|
|
),
|
|
const Divider(),
|
|
androidDisplayModeSetting(),
|
|
androidSecureFlagSetting(),
|
|
const Divider(),
|
|
chooserRootSetting(),
|
|
downloadThreadCountSetting(),
|
|
downloadAndExportPathSetting(),
|
|
exportRenameSetting(),
|
|
fontSetting(),
|
|
usingRightClickPopSetting(),
|
|
const Divider(),
|
|
migrate(context),
|
|
const Divider(),
|
|
autoUpdateCheckSetting(),
|
|
const Divider(),
|
|
],
|
|
),
|
|
);
|
|
|
|
Widget migrate(BuildContext context) {
|
|
if (Platform.isAndroid) {
|
|
return ListTile(
|
|
title: const Text("文件迁移"),
|
|
subtitle: const Text("更换您的数据文件夹"),
|
|
onTap: () async {
|
|
var f =
|
|
await confirmDialog(context, "文件迁移", "此功能菜单保存后, 需要重启程序, 您确认吗");
|
|
if (f) {
|
|
Navigator.of(context).pushAndRemoveUntil(
|
|
MaterialPageRoute(builder: (BuildContext context) {
|
|
return const MigrateScreen();
|
|
}),
|
|
(route) => false,
|
|
);
|
|
}
|
|
},
|
|
);
|
|
}
|
|
return Container();
|
|
}
|
|
|
|
}
|