mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-28 21:30:18 +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
@@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/simple_dialog_option.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/im/type.pbenum.dart';
|
||||
import 'package:PiliPlus/grpc/bilibili/main/community/reply/v1.pb.dart'
|
||||
show ReplyInfo;
|
||||
@@ -169,99 +170,84 @@ abstract final class RequestUtils {
|
||||
String text = isSpecialFollowed ? '移除特别关注' : '加入特别关注';
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
builder: (context) => SimpleDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
final res = await MemberHttp.specialAction(
|
||||
fid: mid,
|
||||
isAdd: !isSpecialFollowed,
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('$text成功');
|
||||
afterMod?.call(isSpecialFollowed ? 2 : -10);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
},
|
||||
title: Text(
|
||||
text,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
final result = await showModalBottomSheet<Set<int>>(
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: min(640, context.mediaQueryShortestSide),
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
final maxChildSize =
|
||||
PlatformUtils.isMobile &&
|
||||
!context.mediaQuerySize.isPortrait
|
||||
? 1.0
|
||||
: 0.7;
|
||||
return DraggableScrollableSheet(
|
||||
minChildSize: 0,
|
||||
maxChildSize: 1,
|
||||
snap: true,
|
||||
expand: false,
|
||||
snapSizes: [maxChildSize],
|
||||
initialChildSize: maxChildSize,
|
||||
builder: (context, scrollController) {
|
||||
return GroupPanel(
|
||||
mid: mid,
|
||||
tags: followStatus!.tag,
|
||||
scrollController: scrollController,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
if (result != null) {
|
||||
followStatus!.tag = result.toList();
|
||||
afterMod?.call(result.contains(-10) ? -10 : 2);
|
||||
}
|
||||
},
|
||||
title: const Text(
|
||||
'设置分组',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
final res = await VideoHttp.relationMod(
|
||||
mid: mid,
|
||||
act: 2,
|
||||
reSrc: 11,
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('取消关注成功');
|
||||
afterMod?.call(0);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
},
|
||||
title: const Text(
|
||||
'取消关注',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
children: [
|
||||
DialogOption(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
final res = await MemberHttp.specialAction(
|
||||
fid: mid,
|
||||
isAdd: !isSpecialFollowed,
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('$text成功');
|
||||
afterMod?.call(isSpecialFollowed ? 2 : -10);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
},
|
||||
child: Text(text, style: const TextStyle(fontSize: 14)),
|
||||
),
|
||||
DialogOption(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
final result = await showModalBottomSheet<Set<int>>(
|
||||
context: context,
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
constraints: BoxConstraints(
|
||||
maxWidth: min(640, context.mediaQueryShortestSide),
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
final maxChildSize =
|
||||
PlatformUtils.isMobile &&
|
||||
!context.mediaQuerySize.isPortrait
|
||||
? 1.0
|
||||
: 0.7;
|
||||
return DraggableScrollableSheet(
|
||||
minChildSize: 0,
|
||||
maxChildSize: 1,
|
||||
snap: true,
|
||||
expand: false,
|
||||
snapSizes: [maxChildSize],
|
||||
initialChildSize: maxChildSize,
|
||||
builder: (context, scrollController) {
|
||||
return GroupPanel(
|
||||
mid: mid,
|
||||
tags: followStatus!.tag,
|
||||
scrollController: scrollController,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
if (result != null) {
|
||||
followStatus!.tag = result.toList();
|
||||
afterMod?.call(result.contains(-10) ? -10 : 2);
|
||||
}
|
||||
},
|
||||
child: const Text('设置分组', style: TextStyle(fontSize: 14)),
|
||||
),
|
||||
DialogOption(
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
final res = await VideoHttp.relationMod(
|
||||
mid: mid,
|
||||
act: 2,
|
||||
reSrc: 11,
|
||||
);
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('取消关注成功');
|
||||
afterMod?.call(0);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
},
|
||||
child: const Text('取消关注', style: TextStyle(fontSize: 14)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user