mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-06 09:10:15 +08:00
opt ui
Closes #1050 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -16,12 +16,13 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: widget.showAppBar == false
|
||||
? null
|
||||
: AppBar(title: const Text('其它设置')),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: settings.map((item) => item.widget).toList(),
|
||||
),
|
||||
|
||||
@@ -172,14 +172,6 @@ List<SettingsModel> get styleSettings => [
|
||||
}
|
||||
},
|
||||
),
|
||||
const SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '播放页移除安全边距',
|
||||
subtitle: '隐藏状态栏、撑满屏幕,但播放控件仍处于安全域内',
|
||||
leading: Icon(Icons.fit_screen_outlined),
|
||||
setKey: SettingBoxKey.videoPlayerRemoveSafeArea,
|
||||
defaultVal: false,
|
||||
),
|
||||
const SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '动态页启用瀑布流',
|
||||
|
||||
@@ -58,6 +58,7 @@ class _BarSetPageState extends State<BarSetPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: Text('$title编辑'),
|
||||
actions: [
|
||||
@@ -68,7 +69,7 @@ class _BarSetPageState extends State<BarSetPage> {
|
||||
body: ReorderableListView(
|
||||
onReorder: onReorder,
|
||||
footer: SizedBox(
|
||||
height: MediaQuery.paddingOf(context).bottom + 30,
|
||||
height: MediaQuery.viewPaddingOf(context).bottom + 30,
|
||||
child: const Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text('*长按拖动排序 '),
|
||||
|
||||
@@ -55,6 +55,7 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
|
||||
);
|
||||
final size = Get.size;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(title: const Text('选择应用主题')),
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
|
||||
@@ -60,9 +60,9 @@ class _SetDisplayModeState extends State<SetDisplayMode> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(title: const Text('屏幕帧率设置')),
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
bottom: false,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPlus/common/widgets/view_safe_area.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
@@ -28,6 +29,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
actions: [
|
||||
TextButton(
|
||||
@@ -41,7 +43,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
const SizedBox(width: 12),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
body: ViewSafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
|
||||
@@ -113,7 +113,9 @@ class _LogsPageState extends State<LogsPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final padding = MediaQuery.viewPaddingOf(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: const Text('日志'),
|
||||
actions: [
|
||||
@@ -162,77 +164,76 @@ class _LogsPageState extends State<LogsPage> {
|
||||
],
|
||||
),
|
||||
body: logsContent.isNotEmpty
|
||||
? SafeArea(
|
||||
bottom: false,
|
||||
child: ListView.separated(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
),
|
||||
itemCount: logsContent.length,
|
||||
itemBuilder: (context, index) {
|
||||
final log = logsContent[index];
|
||||
if (log['date'] is DateTime) {
|
||||
latestLog ??= log['date'];
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 5,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(
|
||||
log['date'].toString(),
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(
|
||||
context,
|
||||
).textTheme.titleMedium!.fontSize,
|
||||
),
|
||||
? ListView.separated(
|
||||
padding: EdgeInsets.only(
|
||||
left: padding.left,
|
||||
right: padding.right,
|
||||
bottom: padding.bottom + 100,
|
||||
),
|
||||
itemCount: logsContent.length,
|
||||
itemBuilder: (context, index) {
|
||||
final log = logsContent[index];
|
||||
if (log['date'] is DateTime) {
|
||||
latestLog ??= log['date'];
|
||||
}
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
spacing: 5,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(
|
||||
log['date'].toString(),
|
||||
style: TextStyle(
|
||||
fontSize: Theme.of(
|
||||
context,
|
||||
).textTheme.titleMedium!.fontSize,
|
||||
),
|
||||
TextButton.icon(
|
||||
style: TextButton.styleFrom(
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
onPressed: () {
|
||||
Utils.copyText(
|
||||
'```\n${log['body']}\n```',
|
||||
needToast: false,
|
||||
);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'已将 ${log['date'].toString()} 复制至剪贴板',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.copy_outlined, size: 16),
|
||||
label: const Text('复制'),
|
||||
),
|
||||
],
|
||||
),
|
||||
Card(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: SelectableText(log['body']),
|
||||
),
|
||||
TextButton.icon(
|
||||
style: TextButton.styleFrom(
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
onPressed: () {
|
||||
Utils.copyText(
|
||||
'```\n${log['body']}\n```',
|
||||
needToast: false,
|
||||
);
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
'已将 ${log['date'].toString()} 复制至剪贴板',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.copy_outlined, size: 16),
|
||||
label: const Text('复制'),
|
||||
),
|
||||
],
|
||||
),
|
||||
Card(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: SelectableText(log['body']),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => const Divider(
|
||||
indent: 12,
|
||||
endIndent: 12,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => const Divider(
|
||||
indent: 12,
|
||||
endIndent: 12,
|
||||
height: 24,
|
||||
),
|
||||
)
|
||||
: scrollErrorWidget(),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/view_safe_area.dart';
|
||||
import 'package:PiliPlus/pages/setting/widgets/switch_item.dart';
|
||||
import 'package:PiliPlus/utils/context_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -148,7 +149,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 25 + MediaQuery.paddingOf(context).bottom),
|
||||
SizedBox(height: 25 + MediaQuery.viewPaddingOf(context).bottom),
|
||||
],
|
||||
);
|
||||
},
|
||||
@@ -186,6 +187,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: const Text('倍速设置'),
|
||||
actions: [
|
||||
@@ -200,8 +202,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
bottom: false,
|
||||
body: ViewSafeArea(
|
||||
child: ListView(
|
||||
children: [
|
||||
Padding(
|
||||
|
||||
@@ -16,12 +16,13 @@ class _PlaySettingState extends State<PlaySetting> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: widget.showAppBar == false
|
||||
? null
|
||||
: AppBar(title: const Text('播放器设置')),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: settings.map((item) => item.widget).toList(),
|
||||
),
|
||||
|
||||
@@ -16,12 +16,13 @@ class _PrivacySettingState extends State<PrivacySetting> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: widget.showAppBar == false
|
||||
? null
|
||||
: AppBar(title: const Text('隐私设置')),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: settings.map((item) => item.widget).toList(),
|
||||
),
|
||||
|
||||
@@ -26,12 +26,13 @@ class _RecommendSettingState extends State<RecommendSetting> {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: widget.showAppBar == false
|
||||
? null
|
||||
: AppBar(title: const Text('推荐流设置')),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: [
|
||||
...part.map((item) => item.widget),
|
||||
|
||||
@@ -64,7 +64,7 @@ class _SlideColorPickerState extends State<SlideColorPicker> {
|
||||
child: SliderTheme(
|
||||
data: SliderTheme.of(context).copyWith(
|
||||
trackHeight: 10,
|
||||
thumbSize: WidgetStateProperty.all(const Size(4, 25)),
|
||||
thumbSize: const WidgetStatePropertyAll(Size(4, 25)),
|
||||
),
|
||||
child: Slider(
|
||||
padding: EdgeInsets.zero,
|
||||
|
||||
@@ -16,12 +16,13 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: widget.showAppBar == false
|
||||
? null
|
||||
: AppBar(title: const Text('外观设置')),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: settings.map((item) => item.widget).toList(),
|
||||
),
|
||||
|
||||
@@ -16,12 +16,13 @@ class _VideoSettingState extends State<VideoSetting> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: widget.showAppBar == false
|
||||
? null
|
||||
: AppBar(title: const Text('音视频设置')),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: settings.map((item) => item.widget).toList(),
|
||||
),
|
||||
|
||||
@@ -89,33 +89,27 @@ class _SettingPageState extends State<SettingPage> {
|
||||
final theme = Theme.of(context);
|
||||
_isPortrait = context.isPortrait;
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: _isPortrait ? const Text('设置') : Text(_type.title),
|
||||
),
|
||||
body: _isPortrait
|
||||
? _buildList(theme)
|
||||
: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeRight: true,
|
||||
removeTop: true,
|
||||
: SafeArea(
|
||||
bottom: false,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: _buildList(theme),
|
||||
),
|
||||
),
|
||||
VerticalDivider(
|
||||
width: 1,
|
||||
color: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||
),
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeLeft: true,
|
||||
removeTop: true,
|
||||
VerticalDivider(
|
||||
width: 1,
|
||||
color: theme.colorScheme.outline.withValues(alpha: 0.1),
|
||||
),
|
||||
Expanded(
|
||||
flex: 6,
|
||||
child: switch (_type) {
|
||||
SettingType.privacySetting => const PrivacySetting(
|
||||
showAppBar: false,
|
||||
@@ -141,8 +135,8 @@ class _SettingPageState extends State<SettingPage> {
|
||||
SettingType.about => const AboutPage(showAppBar: false),
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -175,10 +169,12 @@ class _SettingPageState extends State<SettingPage> {
|
||||
TextStyle subTitleStyle = theme.textTheme.labelMedium!.copyWith(
|
||||
color: theme.colorScheme.outline,
|
||||
);
|
||||
final padding = MediaQuery.paddingOf(context);
|
||||
return ListView(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
|
||||
),
|
||||
children: [
|
||||
_buildSearchItem(theme, padding),
|
||||
_buildSearchItem(theme),
|
||||
..._items
|
||||
.sublist(0, _items.length - 1)
|
||||
.map(
|
||||
@@ -212,7 +208,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
leading: Icon(_items.last.icon),
|
||||
title: Text(_items.last.type.title, style: titleStyle),
|
||||
),
|
||||
SizedBox(height: padding.bottom + 80),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -284,12 +279,8 @@ class _SettingPageState extends State<SettingPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSearchItem(ThemeData theme, EdgeInsets padding) => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 16 + padding.left,
|
||||
right: 16,
|
||||
bottom: 8,
|
||||
),
|
||||
Widget _buildSearchItem(ThemeData theme) => Padding(
|
||||
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 8),
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
|
||||
Reference in New Issue
Block a user