mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-27 21:00:17 +08:00
@@ -1,5 +1,6 @@
|
||||
import 'package:PiliPlus/common/widgets/pair.dart';
|
||||
import 'package:PiliPlus/common/widgets/reorder_mixin.dart';
|
||||
import 'package:PiliPlus/common/widgets/scaffold.dart';
|
||||
import 'package:PiliPlus/models/common/enum_with_label.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -60,8 +61,7 @@ class _BarSetPageState extends State<BarSetPage> with ReorderMixin {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
return scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('$title编辑'),
|
||||
actions: [
|
||||
@@ -76,7 +76,7 @@ class _BarSetPageState extends State<BarSetPage> with ReorderMixin {
|
||||
footer: Padding(
|
||||
padding:
|
||||
MediaQuery.viewPaddingOf(context).copyWith(top: 0, left: 0) +
|
||||
const EdgeInsets.only(right: 34, top: 10),
|
||||
const .only(right: 34, top: 10),
|
||||
child: const Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text('*长按拖动排序'),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/color_palette.dart';
|
||||
import 'package:PiliPlus/common/widgets/scaffold.dart';
|
||||
import 'package:PiliPlus/main.dart' show MyApp;
|
||||
import 'package:PiliPlus/models/common/nav_bar_config.dart';
|
||||
import 'package:PiliPlus/models/common/theme/theme_color_type.dart';
|
||||
@@ -65,10 +66,10 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
|
||||
final padding = MediaQuery.viewPaddingOf(
|
||||
context,
|
||||
).copyWith(top: 0, bottom: 0);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
return scaffold(
|
||||
appBar: AppBar(title: const Text('选择应用主题')),
|
||||
body: ListView(
|
||||
padding: .only(bottom: MediaQuery.viewPaddingOf(context).bottom),
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () async {
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class FontSizeSelectPage extends StatefulWidget {
|
||||
const FontSizeSelectPage({super.key});
|
||||
|
||||
@override
|
||||
State<FontSizeSelectPage> createState() => _FontSizeSelectPageState();
|
||||
}
|
||||
|
||||
class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
List<double> list = List.generate(16, (index) => 0.85 + index * 0.05);
|
||||
late double minSize = list.first;
|
||||
late double maxSize = list.last;
|
||||
double currentSize = Pref.defaultTextScale;
|
||||
|
||||
void setFontSize() {
|
||||
GStorage.setting.put(SettingBoxKey.defaultTextScale, currentSize);
|
||||
Get
|
||||
..back(result: currentSize)
|
||||
..appUpdate();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
currentSize = 1.0;
|
||||
setFontSize();
|
||||
},
|
||||
child: const Text('重置'),
|
||||
),
|
||||
TextButton(onPressed: setFontSize, child: const Text('确定')),
|
||||
const SizedBox(width: 12),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Text(
|
||||
'当前字体大小:${currentSize == 1.0 ? '默认' : currentSize}',
|
||||
style: TextStyle(fontSize: 14 * currentSize),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.3),
|
||||
),
|
||||
),
|
||||
color: theme.colorScheme.surface,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Text('小'),
|
||||
Expanded(
|
||||
child: Slider(
|
||||
min: minSize,
|
||||
value: currentSize,
|
||||
max: maxSize,
|
||||
divisions: list.length - 1,
|
||||
secondaryTrackValue: 1,
|
||||
onChanged: (double val) {
|
||||
currentSize = val.toPrecision(2);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
const Text(
|
||||
'大',
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
import 'dart:io' show Platform;
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||
import 'package:PiliPlus/common/widgets/extra_hittest_stack.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_superchat/item.dart';
|
||||
import 'package:PiliPlus/pages/live_room/superchat/superchat_card.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/utils/fullscreen.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const kFullScreenSCWidth = 255.0;
|
||||
|
||||
class FullScreenScSize extends StatefulWidget {
|
||||
const FullScreenScSize({super.key});
|
||||
|
||||
@override
|
||||
State<FullScreenScSize> createState() => _FullScreenScSizeState();
|
||||
}
|
||||
|
||||
class _FullScreenScSizeState extends State<FullScreenScSize> {
|
||||
double _width = Pref.fullScreenSCWidth;
|
||||
final _randomSC = SuperChatItem.random;
|
||||
late EdgeInsets _padding;
|
||||
late ColorScheme _colorScheme;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (Platform.isAndroid) {
|
||||
landscapeLeftMode();
|
||||
} else if (Platform.isIOS) {
|
||||
landscapeRightMode();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (PlatformUtils.isMobile) {
|
||||
if (Pref.horizontalScreen) {
|
||||
fullMode();
|
||||
} else {
|
||||
portraitUpMode();
|
||||
}
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
final padding = MediaQuery.viewPaddingOf(context);
|
||||
_padding = .only(
|
||||
right: padding.right + 17,
|
||||
left: padding.left + 25,
|
||||
bottom: padding.bottom + 25,
|
||||
);
|
||||
_colorScheme = ColorScheme.of(context);
|
||||
}
|
||||
|
||||
void _onReset() {
|
||||
_width = kFullScreenSCWidth;
|
||||
GStorage.setting.delete(SettingBoxKey.fullScreenSCWidth);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: const Text('全屏 SC 大小设置'),
|
||||
actions: [
|
||||
TextButton(onPressed: _onReset, child: const Text('重置')),
|
||||
],
|
||||
),
|
||||
body: Padding(padding: _padding, child: _buildBody),
|
||||
);
|
||||
}
|
||||
|
||||
Widget get _buildBody {
|
||||
return Align(
|
||||
alignment: .bottomLeft,
|
||||
child: ExtraHitTestStack(
|
||||
clipBehavior: .none,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: _width,
|
||||
child: IgnorePointer(
|
||||
child: SuperChatCard(
|
||||
item: _randomSC,
|
||||
persistentSC: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
right: -17,
|
||||
width: 34,
|
||||
child: MouseRegion(
|
||||
cursor: SystemMouseCursors.resizeRight,
|
||||
child: GestureDetector(
|
||||
behavior: .opaque,
|
||||
onHorizontalDragUpdate: _onHorizontalDragUpdate,
|
||||
onHorizontalDragEnd: _onHorizontalDragEnd,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
shape: .circle,
|
||||
color: _colorScheme.secondaryContainer.withValues(
|
||||
alpha: .8,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
size: 18,
|
||||
CustomIcons.open_in_full_rotate_45,
|
||||
color: _colorScheme.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onHorizontalDragUpdate(DragUpdateDetails details) {
|
||||
_width = math.max(25.0, _width + details.delta.dx);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void _onHorizontalDragEnd(DragEndDetails details) {
|
||||
GStorage.setting.put(SettingBoxKey.fullScreenSCWidth, _width);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/loading_widget/loading_widget.dart';
|
||||
import 'package:PiliPlus/common/widgets/scaffold.dart';
|
||||
import 'package:PiliPlus/services/logger.dart';
|
||||
import 'package:PiliPlus/utils/date_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
@@ -17,8 +16,6 @@ import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
const _snackBarDisplayDuration = Duration(seconds: 1);
|
||||
|
||||
class LogsPage extends StatefulWidget {
|
||||
const LogsPage({super.key});
|
||||
|
||||
@@ -75,29 +72,13 @@ class _LogsPageState extends State<LogsPage> {
|
||||
}
|
||||
|
||||
void copyLogs() {
|
||||
Utils.copyText(
|
||||
'```\n${logsContent.join('\n\n')}```',
|
||||
needToast: false,
|
||||
);
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('复制成功'),
|
||||
duration: _snackBarDisplayDuration,
|
||||
),
|
||||
);
|
||||
}
|
||||
Utils.copyText('```\n${logsContent.join('\n\n')}```');
|
||||
}
|
||||
|
||||
Future<void> clearLogs() async {
|
||||
if (await LoggerUtils.clearLogs()) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('已清空'),
|
||||
duration: _snackBarDisplayDuration,
|
||||
),
|
||||
);
|
||||
SmartDialog.showToast('已清空');
|
||||
logsContent.clear();
|
||||
setState(() {});
|
||||
}
|
||||
@@ -107,8 +88,7 @@ class _LogsPageState extends State<LogsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final padding = MediaQuery.viewPaddingOf(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
return scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('日志'),
|
||||
actions: [
|
||||
@@ -140,11 +120,6 @@ class _LogsPageState extends State<LogsPage> {
|
||||
onTap: copyLogs,
|
||||
child: const Text('复制日志'),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
PageUtils.launchURL('${Constants.sourceCodeUrl}/issues'),
|
||||
child: const Text('错误反馈'),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () {
|
||||
latestLog = null;
|
||||
@@ -334,15 +309,7 @@ class ReportCard extends StatelessWidget {
|
||||
iconButton(
|
||||
size: 34,
|
||||
iconSize: 22,
|
||||
onPressed: () {
|
||||
Utils.copyText('```\n$report```', needToast: false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('已将 $dateTime 复制至剪贴板'),
|
||||
duration: _snackBarDisplayDuration,
|
||||
),
|
||||
);
|
||||
},
|
||||
onPressed: () => Utils.copyText('```\n$report```'),
|
||||
icon: const Icon(
|
||||
Icons.copy_outlined,
|
||||
size: 16,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/flutter/list_tile.dart';
|
||||
import 'package:PiliPlus/common/widgets/scaffold.dart';
|
||||
import 'package:PiliPlus/common/widgets/view_safe_area.dart';
|
||||
import 'package:PiliPlus/pages/setting/widgets/switch_item.dart';
|
||||
import 'package:PiliPlus/utils/extension/context_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
@@ -24,7 +24,6 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
late double playSpeedDefault = Pref.playSpeedDefault;
|
||||
late double longPressSpeedDefault = Pref.longPressSpeedDefault;
|
||||
late List<double> speedList = Pref.speedList;
|
||||
late bool enableAutoLongPressSpeed = Pref.enableAutoLongPressSpeed;
|
||||
List<({int id, String title, Icon icon})> sheetMenu = [
|
||||
(
|
||||
id: 1,
|
||||
@@ -130,9 +129,6 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
const SizedBox(height: 10),
|
||||
...sheetMenu.map(
|
||||
(item) => ListTile(
|
||||
enabled: enableAutoLongPressSpeed && item.id == 2
|
||||
? false
|
||||
: true,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
menuAction(index, item.id);
|
||||
@@ -183,8 +179,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
return scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('倍速设置'),
|
||||
actions: [
|
||||
@@ -201,6 +196,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
),
|
||||
body: ViewSafeArea(
|
||||
child: ListView(
|
||||
padding: .zero,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
@@ -218,19 +214,10 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
title: const Text('默认倍速'),
|
||||
subtitle: Text(playSpeedDefault.toString()),
|
||||
),
|
||||
SetSwitchItem(
|
||||
title: '动态长按倍速',
|
||||
subtitle: '根据默认倍速长按时自动双倍',
|
||||
setKey: SettingBoxKey.enableAutoLongPressSpeed,
|
||||
defaultVal: enableAutoLongPressSpeed,
|
||||
onChanged: (val) =>
|
||||
setState(() => enableAutoLongPressSpeed = val),
|
||||
ListTile(
|
||||
title: const Text('默认长按倍速'),
|
||||
subtitle: Text(longPressSpeedDefault.toString()),
|
||||
),
|
||||
if (!enableAutoLongPressSpeed)
|
||||
ListTile(
|
||||
title: const Text('默认长按倍速'),
|
||||
subtitle: Text(longPressSpeedDefault.toString()),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 14,
|
||||
|
||||
Reference in New Issue
Block a user