mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-28 13:20:16 +08:00
tweaks (#2426)
* opt: danmaku weight
* opt: cache clean
* opt: level img
* opt: play icon
* opt: svg big-vip
* opt: webview ua
* opt: simple dialog
* feat: export vtt
* tweak
* opt: mapIndexed
* feat: more subtitle
* refa: settings page
* feat: codec list options
* drawPath
Signed-off-by: dom <githubaccount56556@proton.me>
* custom dialog option
Signed-off-by: dom <githubaccount56556@proton.me>
* update
Signed-off-by: dom <githubaccount56556@proton.me>
* Revert "drawPath"
This reverts commit e8a4b19f0f.
* opt: _initStreamIndex
* fix: avoid gap
* fix: scale [skip ci]
* fix: hide repost menu not login
* tweaks
Signed-off-by: dom <githubaccount56556@proton.me>
---------
Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
3dee6a85e5
commit
9d94c72e95
@@ -64,42 +64,39 @@ void showPgcFollowDialog({
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
builder: (context) => SimpleDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
...const [
|
||||
(followStatus: 3, title: '看过'),
|
||||
(followStatus: 2, title: '在看'),
|
||||
(followStatus: 1, title: '想看'),
|
||||
].map(
|
||||
(item) => statusItem(
|
||||
enabled: followStatus != item.followStatus,
|
||||
text: item.title,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onUpdateStatus(item.followStatus);
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
'取消$type',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
children: [
|
||||
...const [
|
||||
(followStatus: 3, title: '看过'),
|
||||
(followStatus: 2, title: '在看'),
|
||||
(followStatus: 1, title: '想看'),
|
||||
].map(
|
||||
(item) => statusItem(
|
||||
enabled: followStatus != item.followStatus,
|
||||
text: item.title,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onUpdateStatus(-1);
|
||||
onUpdateStatus(item.followStatus);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
'取消$type',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
onUpdateStatus(-1);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:async' show FutureOr;
|
||||
import 'dart:convert' show utf8, jsonDecode;
|
||||
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/simple_dialog_option.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
@@ -214,21 +215,19 @@ Future<void> showImportExportDialog<T>(
|
||||
builder: (context) {
|
||||
const style = TextStyle(fontSize: 15);
|
||||
return SimpleDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
clipBehavior: .hardEdge,
|
||||
title: Text('导入/导出$title'),
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text('导出至剪贴板', style: style),
|
||||
onTap: () {
|
||||
DialogOption(
|
||||
child: const Text('导出至剪贴板', style: style),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
exportToClipBoard(onExport: onExport);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text('导出文件至本地', style: style),
|
||||
onTap: () {
|
||||
DialogOption(
|
||||
child: const Text('导出文件至本地', style: style),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
exportToLocalFile(onExport: onExport, localFileName: localFileName);
|
||||
},
|
||||
@@ -237,18 +236,16 @@ Future<void> showImportExportDialog<T>(
|
||||
height: 1,
|
||||
color: ColorScheme.of(context).outline.withValues(alpha: 0.1),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text('输入', style: style),
|
||||
onTap: () {
|
||||
DialogOption(
|
||||
child: const Text('输入', style: style),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
importFromInput<T>(context, title: title, onImport: onImport);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text('从剪贴板导入', style: style),
|
||||
onTap: () {
|
||||
DialogOption(
|
||||
child: const Text('从剪贴板导入', style: style),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
importFromClipBoard<T>(
|
||||
context,
|
||||
@@ -258,10 +255,9 @@ Future<void> showImportExportDialog<T>(
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text('从本地文件导入', style: style),
|
||||
onTap: () {
|
||||
DialogOption(
|
||||
child: const Text('从本地文件导入', style: style),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
importFromLocalFile<T>(onImport: onImport);
|
||||
},
|
||||
|
||||
29
lib/common/widgets/dialog/simple_dialog_option.dart
Normal file
29
lib/common/widgets/dialog/simple_dialog_option.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
final EdgeInsets _padding = PlatformUtils.isMobile
|
||||
? const .symmetric(horizontal: 16, vertical: 14)
|
||||
: const .symmetric(horizontal: 16, vertical: 10);
|
||||
|
||||
class DialogOption extends StatelessWidget {
|
||||
const DialogOption({
|
||||
super.key,
|
||||
this.onPressed,
|
||||
this.child,
|
||||
});
|
||||
|
||||
final VoidCallback? onPressed;
|
||||
|
||||
final Widget? child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onPressed,
|
||||
child: Padding(
|
||||
padding: _padding,
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user