mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 04:00:28 +08:00
@@ -58,21 +58,19 @@ abstract final class ImageUtils {
|
||||
if (status == PermissionStatus.denied ||
|
||||
status == PermissionStatus.permanentlyDenied) {
|
||||
SmartDialog.show(
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('提示'),
|
||||
content: const Text('存储权限未授权'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
SmartDialog.dismiss();
|
||||
openAppSettings();
|
||||
},
|
||||
child: const Text('去授权'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('提示'),
|
||||
content: const Text('存储权限未授权'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
SmartDialog.dismiss();
|
||||
openAppSettings();
|
||||
},
|
||||
child: const Text('去授权'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
return false;
|
||||
} else {
|
||||
|
||||
@@ -130,11 +130,11 @@ abstract final class PageUtils {
|
||||
builder: (_, setState) {
|
||||
void onTap(int choice) {
|
||||
if (choice == -1) {
|
||||
String duration = '';
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
String duration = '';
|
||||
final theme = Theme.of(context);
|
||||
return AlertDialog(
|
||||
title: const Text('自定义时长'),
|
||||
content: TextField(
|
||||
|
||||
@@ -131,110 +131,108 @@ abstract final class RequestUtils {
|
||||
}
|
||||
|
||||
if (context.mounted) {
|
||||
bool isSpecialFollowed = followStatus!['special'] == 1;
|
||||
String text = isSpecialFollowed ? '移除特别关注' : '加入特别关注';
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
bool isSpecialFollowed = followStatus!['special'] == 1;
|
||||
String text = isSpecialFollowed ? '移除特别关注' : '加入特别关注';
|
||||
return AlertDialog(
|
||||
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),
|
||||
),
|
||||
builder: (context) => AlertDialog(
|
||||
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:
|
||||
(
|
||||
BuildContext context,
|
||||
ScrollController scrollController,
|
||||
) {
|
||||
return GroupPanel(
|
||||
mid: mid,
|
||||
tags: followStatus!['tag'],
|
||||
scrollController: scrollController,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
followStatus!['tag'] = result?.toList();
|
||||
if (result != null) {
|
||||
afterMod?.call(result.contains(-10) ? -10 : 2);
|
||||
}
|
||||
},
|
||||
title: const Text(
|
||||
'设置分组',
|
||||
style: 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:
|
||||
(
|
||||
BuildContext context,
|
||||
ScrollController scrollController,
|
||||
) {
|
||||
return GroupPanel(
|
||||
mid: mid,
|
||||
tags: followStatus!['tag'],
|
||||
scrollController: scrollController,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
followStatus!['tag'] = result?.toList();
|
||||
if (result != null) {
|
||||
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),
|
||||
),
|
||||
),
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,8 @@ abstract final class ThemeUtils {
|
||||
selectionHandleColor: colorScheme.primary,
|
||||
),
|
||||
switchTheme: const SwitchThemeData(
|
||||
padding: .zero,
|
||||
materialTapTargetSize: .shrinkWrap,
|
||||
thumbIcon: WidgetStateProperty<Icon?>.fromMap(
|
||||
<WidgetStatesConstraint, Icon?>{
|
||||
WidgetState.selected: Icon(Icons.done),
|
||||
|
||||
Reference in New Issue
Block a user