mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-24 03:00:13 +08:00
@@ -1,50 +1,35 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget iconButton({
|
||||
required BuildContext context,
|
||||
BuildContext? context,
|
||||
String? tooltip,
|
||||
required IconData icon,
|
||||
required Icon icon,
|
||||
required VoidCallback? onPressed,
|
||||
double size = 36,
|
||||
double? iconSize,
|
||||
Color? bgColor,
|
||||
Color? iconColor,
|
||||
}) {
|
||||
late final theme = Theme.of(context);
|
||||
Color? backgroundColor = bgColor;
|
||||
Color? foregroundColor = iconColor;
|
||||
if (context != null) {
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
backgroundColor = colorScheme.secondaryContainer;
|
||||
foregroundColor = colorScheme.onSecondaryContainer;
|
||||
}
|
||||
return SizedBox(
|
||||
width: size,
|
||||
height: size,
|
||||
child: IconButton(
|
||||
icon: icon,
|
||||
tooltip: tooltip,
|
||||
onPressed: onPressed,
|
||||
icon: Icon(
|
||||
icon,
|
||||
size: iconSize ?? size / 2,
|
||||
color: iconColor ?? theme.colorScheme.onSecondaryContainer,
|
||||
),
|
||||
style: IconButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
backgroundColor: bgColor ?? theme.colorScheme.secondaryContainer,
|
||||
iconSize: iconSize ?? size / 2,
|
||||
backgroundColor: backgroundColor,
|
||||
foregroundColor: foregroundColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget mediumButton({
|
||||
String? tooltip,
|
||||
IconData? icon,
|
||||
VoidCallback? onPressed,
|
||||
}) {
|
||||
return SizedBox(
|
||||
width: 34,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
tooltip: tooltip,
|
||||
icon: Icon(icon),
|
||||
style: const ButtonStyle(
|
||||
padding: WidgetStatePropertyAll(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: onPressed,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,20 +19,16 @@ void imageSaveDialog({
|
||||
animationType: SmartAnimationType.centerScale_otherSlide,
|
||||
builder: (context) {
|
||||
final theme = Theme.of(context);
|
||||
late final iconColor = theme.colorScheme.onSurfaceVariant;
|
||||
|
||||
Widget iconBtn({
|
||||
String? tooltip,
|
||||
required IconData icon,
|
||||
required Icon icon,
|
||||
required VoidCallback? onPressed,
|
||||
}) {
|
||||
return iconButton(
|
||||
context: context,
|
||||
onPressed: onPressed,
|
||||
iconSize: 20,
|
||||
icon: icon,
|
||||
bgColor: Colors.transparent,
|
||||
iconColor: iconColor,
|
||||
iconSize: 20,
|
||||
onPressed: onPressed,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -105,7 +101,7 @@ void imageSaveDialog({
|
||||
(res) => SmartDialog.showToast(res['msg']),
|
||||
),
|
||||
},
|
||||
icon: Icons.watch_later_outlined,
|
||||
icon: const Icon(Icons.watch_later_outlined),
|
||||
),
|
||||
if (cover?.isNotEmpty == true) ...[
|
||||
if (Utils.isMobile)
|
||||
@@ -115,7 +111,7 @@ void imageSaveDialog({
|
||||
SmartDialog.dismiss();
|
||||
ImageUtils.onShareImg(cover!);
|
||||
},
|
||||
icon: Icons.share,
|
||||
icon: const Icon(Icons.share),
|
||||
),
|
||||
iconBtn(
|
||||
tooltip: '保存封面图',
|
||||
@@ -128,7 +124,7 @@ void imageSaveDialog({
|
||||
SmartDialog.dismiss();
|
||||
}
|
||||
},
|
||||
icon: Icons.download,
|
||||
icon: const Icon(Icons.download),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
@@ -248,8 +248,7 @@ class _AudioPageState extends State<AudioPage> {
|
||||
trailing: isCurr
|
||||
? null
|
||||
: iconButton(
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
if (index < _controller.index!) {
|
||||
_controller.index -= 1;
|
||||
@@ -260,7 +259,6 @@ class _AudioPageState extends State<AudioPage> {
|
||||
(context as Element)
|
||||
.markNeedsBuild();
|
||||
},
|
||||
bgColor: Colors.transparent,
|
||||
iconColor: colorScheme.outline,
|
||||
size: 28,
|
||||
iconSize: 18,
|
||||
|
||||
@@ -124,8 +124,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
|
||||
top: 34,
|
||||
right: 5,
|
||||
child: iconButton(
|
||||
context: context,
|
||||
icon: Icons.edit,
|
||||
icon: const Icon(Icons.edit),
|
||||
onPressed: () => onCropImage(index),
|
||||
size: 24,
|
||||
iconSize: 14,
|
||||
@@ -136,8 +135,7 @@ abstract class CommonRichTextPubPageState<T extends CommonRichTextPubPage>
|
||||
top: 5,
|
||||
right: 5,
|
||||
child: iconButton(
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: onClear,
|
||||
size: 24,
|
||||
iconSize: 14,
|
||||
|
||||
@@ -171,8 +171,7 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
|
||||
iconButton(
|
||||
size: 22,
|
||||
iconSize: 16,
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
bgColor: theme.colorScheme.onInverseSurface,
|
||||
iconColor: theme.colorScheme.onSurfaceVariant,
|
||||
onPressed: () => topic.value = null,
|
||||
@@ -804,12 +803,10 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
|
||||
right: 18,
|
||||
top: 2,
|
||||
child: iconButton(
|
||||
context: context,
|
||||
size: 30,
|
||||
iconSize: 18,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () => _reserveCard.value = null,
|
||||
bgColor: Colors.transparent,
|
||||
iconColor: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -324,10 +324,8 @@ class _CreateVotePageState extends State<CreateVotePage> {
|
||||
size: 26,
|
||||
iconSize: 18,
|
||||
tooltip: '移除',
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: onDel,
|
||||
bgColor: Colors.transparent,
|
||||
iconColor: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -175,8 +175,6 @@ class _EmotePanelState extends State<EmotePanel>
|
||||
iconSize: 20,
|
||||
iconColor: theme.colorScheme.onSurfaceVariant
|
||||
.withValues(alpha: 0.8),
|
||||
bgColor: Colors.transparent,
|
||||
context: context,
|
||||
onPressed: () {
|
||||
final isDark = Get.isDarkMode;
|
||||
Get.toNamed(
|
||||
@@ -187,7 +185,7 @@ class _EmotePanelState extends State<EmotePanel>
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: Icons.settings,
|
||||
icon: const Icon(Icons.settings),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
||||
@@ -574,11 +574,12 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
|
||||
Widget _buildFavBtn(LoadingState<bool> loadingState) {
|
||||
return switch (loadingState) {
|
||||
Success(:var response) => mediumButton(
|
||||
Success(:var response) => iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: response ? '取消订阅' : '订阅',
|
||||
icon: response
|
||||
? Icons.notifications_off_outlined
|
||||
: Icons.notifications_active_outlined,
|
||||
? const Icon(Icons.notifications_off_outlined)
|
||||
: const Icon(Icons.notifications_active_outlined),
|
||||
onPressed: () async {
|
||||
var result = await FavHttp.seasonFav(
|
||||
isFav: response,
|
||||
@@ -596,11 +597,12 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
};
|
||||
}
|
||||
|
||||
Widget get _buildReverseBtn => mediumButton(
|
||||
Widget get _buildReverseBtn => iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: widget.isReversed == true ? '正序播放' : '倒序播放',
|
||||
icon: widget.isReversed == true
|
||||
? MdiIcons.sortDescending
|
||||
: MdiIcons.sortAscending,
|
||||
? const Icon(MdiIcons.sortDescending)
|
||||
: const Icon(MdiIcons.sortAscending),
|
||||
onPressed: () => widget.onReverse?.call(),
|
||||
);
|
||||
|
||||
@@ -632,19 +634,22 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
if (_favState != null) Obx(() => _buildFavBtn(_favState!.value)),
|
||||
mediumButton(
|
||||
iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: '跳至顶部',
|
||||
icon: Icons.vertical_align_top,
|
||||
icon: const Icon(Icons.vertical_align_top),
|
||||
onPressed: _animToTopOrBottom,
|
||||
),
|
||||
mediumButton(
|
||||
iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: '跳至底部',
|
||||
icon: Icons.vertical_align_bottom,
|
||||
icon: const Icon(Icons.vertical_align_bottom),
|
||||
onPressed: () => _animToTopOrBottom(top: false),
|
||||
),
|
||||
mediumButton(
|
||||
iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: '跳至当前',
|
||||
icon: Icons.my_location,
|
||||
icon: const Icon(Icons.my_location),
|
||||
onPressed: () async {
|
||||
final currentTabIndex = _currentTabIndex.value;
|
||||
if (currentTabIndex != widget.initialTabIndex) {
|
||||
@@ -669,11 +674,12 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
Obx(
|
||||
() {
|
||||
final currentTabIndex = _currentTabIndex.value;
|
||||
return mediumButton(
|
||||
return iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: _isReversed[currentTabIndex] ? '顺序' : '倒序',
|
||||
icon: !_isReversed[currentTabIndex]
|
||||
? MdiIcons.sortNumericAscending
|
||||
: MdiIcons.sortNumericDescending,
|
||||
? const Icon(MdiIcons.sortNumericAscending)
|
||||
: const Icon(MdiIcons.sortNumericDescending),
|
||||
onPressed: () => setState(() {
|
||||
_isReversed[currentTabIndex] = !_isReversed[currentTabIndex];
|
||||
}),
|
||||
@@ -681,9 +687,10 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
},
|
||||
),
|
||||
if (widget.onClose != null)
|
||||
mediumButton(
|
||||
iconButton(
|
||||
iconSize: 22,
|
||||
tooltip: '关闭',
|
||||
icon: Icons.close,
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: widget.onClose,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -117,11 +117,9 @@ class FavArticleItem extends StatelessWidget {
|
||||
bottom: -6,
|
||||
child: iconButton(
|
||||
iconSize: 18,
|
||||
context: context,
|
||||
onPressed: onDelete,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
iconColor: theme.colorScheme.outline,
|
||||
bgColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -79,7 +79,7 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
|
||||
size: 32,
|
||||
tooltip: '取消',
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: _favNoteController.onDisable,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
|
||||
@@ -85,7 +85,7 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
|
||||
size: 32,
|
||||
tooltip: '取消',
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: _favPgcController.onDisable,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
|
||||
@@ -140,11 +140,9 @@ class FavPgcItem extends StatelessWidget {
|
||||
bottom: 0,
|
||||
child: iconButton(
|
||||
iconSize: 18,
|
||||
context: context,
|
||||
onPressed: onUpdateStatus,
|
||||
icon: Icons.more_vert,
|
||||
icon: const Icon(Icons.more_vert),
|
||||
iconColor: theme.colorScheme.outline,
|
||||
bgColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -399,24 +399,25 @@ class _FavDetailPageState extends State<FavDetailPage> with GridMixin {
|
||||
right: 6,
|
||||
top: 6,
|
||||
child: Obx(() {
|
||||
if (_favDetailController.isOwner) {
|
||||
if (_favDetailController.isOwner ||
|
||||
_favDetailController.loadingState.value
|
||||
is! Success) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
bool isFav = folderInfo.favState == 1;
|
||||
return iconButton(
|
||||
context: context,
|
||||
size: 28,
|
||||
iconSize: 18,
|
||||
tooltip: '${isFav ? '取消' : ''}收藏',
|
||||
onPressed: () => _favDetailController.onFav(isFav),
|
||||
icon: isFav
|
||||
? Icons.favorite
|
||||
: Icons.favorite_border,
|
||||
? const Icon(Icons.favorite)
|
||||
: const Icon(Icons.favorite_border),
|
||||
bgColor: isFav
|
||||
? null
|
||||
? theme.colorScheme.secondaryContainer
|
||||
: theme.colorScheme.onInverseSurface,
|
||||
iconColor: isFav
|
||||
? null
|
||||
? theme.colorScheme.onSecondaryContainer
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -212,11 +212,9 @@ class FavVideoCardH extends StatelessWidget {
|
||||
right: 0,
|
||||
bottom: -8,
|
||||
child: iconButton(
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
tooltip: '取消收藏',
|
||||
iconColor: theme.colorScheme.outline,
|
||||
bgColor: Colors.transparent,
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
||||
@@ -258,11 +258,9 @@ class VideoCardHLater extends StatelessWidget {
|
||||
bottom: -8,
|
||||
child: iconButton(
|
||||
tooltip: '移除',
|
||||
context: context,
|
||||
onPressed: () => ctr.toViewDel(context, index, videoItem.aid),
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
iconColor: theme.colorScheme.outline,
|
||||
bgColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -129,7 +129,7 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
|
||||
iconSize: 16,
|
||||
context: context,
|
||||
tooltip: '全部标签',
|
||||
icon: Icons.widgets,
|
||||
icon: const Icon(Icons.widgets),
|
||||
onPressed: () => Get.to(const LiveAreaPage()),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -286,10 +286,15 @@ class _LiveAreaPageState extends State<LiveAreaPage> {
|
||||
return iconButton(
|
||||
size: 17,
|
||||
iconSize: 13,
|
||||
context: context,
|
||||
icon: isFav ? MdiIcons.check : MdiIcons.plus,
|
||||
bgColor: isFav ? theme.colorScheme.onInverseSurface : null,
|
||||
iconColor: isFav ? theme.colorScheme.outline : null,
|
||||
icon: isFav
|
||||
? const Icon(MdiIcons.check)
|
||||
: const Icon(MdiIcons.plus),
|
||||
bgColor: isFav
|
||||
? theme.colorScheme.onInverseSurface
|
||||
: theme.colorScheme.secondaryContainer,
|
||||
iconColor: isFav
|
||||
? theme.colorScheme.outline
|
||||
: theme.colorScheme.onSecondaryContainer,
|
||||
onPressed: onPressed,
|
||||
);
|
||||
}
|
||||
@@ -350,8 +355,7 @@ class _LiveAreaPageState extends State<LiveAreaPage> {
|
||||
return iconButton(
|
||||
size: 16,
|
||||
iconSize: 12,
|
||||
context: context,
|
||||
icon: Icons.horizontal_rule,
|
||||
icon: const Icon(Icons.horizontal_rule),
|
||||
bgColor: isDark
|
||||
? theme.colorScheme.error
|
||||
: theme.colorScheme.errorContainer,
|
||||
|
||||
@@ -101,9 +101,7 @@ class _LiveAreaDetailPageState extends State<LiveAreaDetailPage> {
|
||||
),
|
||||
),
|
||||
iconButton(
|
||||
context: context,
|
||||
icon: Icons.menu,
|
||||
bgColor: Colors.transparent,
|
||||
icon: const Icon(Icons.menu),
|
||||
onPressed: () =>
|
||||
_showTags(context, theme, bottom, response),
|
||||
),
|
||||
|
||||
@@ -321,10 +321,9 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
child: iconButton(
|
||||
size: 24,
|
||||
iconSize: 14,
|
||||
context: context,
|
||||
bgColor: const Color(0xEEFFFFFF),
|
||||
iconColor: Colors.black54,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () =>
|
||||
_liveRoomController.fsSC.value = null,
|
||||
),
|
||||
|
||||
@@ -374,10 +374,8 @@ class LoginPageController extends GetxController
|
||||
hintText: "请输入短信验证码",
|
||||
hintStyle: const TextStyle(fontSize: 15),
|
||||
suffixIcon: iconButton(
|
||||
context: Get.context!,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
size: 32,
|
||||
bgColor: Colors.transparent,
|
||||
onPressed: textFieldController.clear,
|
||||
),
|
||||
suffixIconConstraints: const BoxConstraints(
|
||||
|
||||
@@ -63,11 +63,9 @@ class MemberCheeseItem extends StatelessWidget {
|
||||
bottom: -8,
|
||||
child: iconButton(
|
||||
tooltip: '移除',
|
||||
context: context,
|
||||
onPressed: onRemove,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
iconColor: theme.colorScheme.outline,
|
||||
bgColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/custom_icon.dart';
|
||||
import 'package:PiliPlus/http/pgc.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
@@ -62,14 +61,11 @@ class _PgcReviewPostPanelState extends State<PgcReviewPostPanel> {
|
||||
toolbarHeight: 45,
|
||||
title: Text(widget.name),
|
||||
actions: [
|
||||
iconButton(
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
IconButton(
|
||||
icon: const Icon(Icons.clear, size: 20),
|
||||
onPressed: Get.back,
|
||||
iconSize: 22,
|
||||
bgColor: Colors.transparent,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const SizedBox(width: 2),
|
||||
],
|
||||
shape: Border(
|
||||
bottom: BorderSide(
|
||||
|
||||
@@ -558,8 +558,7 @@ class _SavePanelState extends State<SavePanel> {
|
||||
iconButton(
|
||||
size: 42,
|
||||
tooltip: '关闭',
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: Get.back,
|
||||
bgColor: theme.colorScheme.onInverseSurface,
|
||||
iconColor: theme.colorScheme.onSurfaceVariant,
|
||||
@@ -569,8 +568,8 @@ class _SavePanelState extends State<SavePanel> {
|
||||
tooltip: showBottom ? '隐藏' : '显示',
|
||||
context: context,
|
||||
icon: showBottom
|
||||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
? const Icon(Icons.visibility_off)
|
||||
: const Icon(Icons.visibility),
|
||||
onPressed: () => setState(() {
|
||||
showBottom = !showBottom;
|
||||
}),
|
||||
@@ -580,14 +579,14 @@ class _SavePanelState extends State<SavePanel> {
|
||||
size: 42,
|
||||
tooltip: '分享',
|
||||
context: context,
|
||||
icon: Icons.share,
|
||||
icon: const Icon(Icons.share),
|
||||
onPressed: () => _onSaveOrSharePic(true),
|
||||
),
|
||||
iconButton(
|
||||
size: 42,
|
||||
tooltip: '保存',
|
||||
context: context,
|
||||
icon: Icons.save_alt,
|
||||
icon: const Icon(Icons.save_alt),
|
||||
onPressed: _onSaveOrSharePic,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -23,7 +23,7 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
class _SettingsModel {
|
||||
final SettingType type;
|
||||
final String? subtitle;
|
||||
final IconData icon;
|
||||
final Icon icon;
|
||||
|
||||
const _SettingsModel({
|
||||
required this.type,
|
||||
@@ -48,40 +48,40 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_SettingsModel(
|
||||
type: SettingType.privacySetting,
|
||||
subtitle: '黑名单、无痕模式',
|
||||
icon: Icons.privacy_tip_outlined,
|
||||
icon: Icon(Icons.privacy_tip_outlined),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.recommendSetting,
|
||||
subtitle: '推荐来源(web/app)、刷新保留内容、过滤器',
|
||||
icon: Icons.explore_outlined,
|
||||
icon: Icon(Icons.explore_outlined),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.videoSetting,
|
||||
subtitle: '画质、音质、解码、缓冲、音频输出等',
|
||||
icon: Icons.video_settings_outlined,
|
||||
icon: Icon(Icons.video_settings_outlined),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.playSetting,
|
||||
subtitle: '双击/长按、全屏、后台播放、弹幕、字幕、底部进度条等',
|
||||
icon: Icons.touch_app_outlined,
|
||||
icon: Icon(Icons.touch_app_outlined),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.styleSetting,
|
||||
subtitle: '横屏适配(平板)、侧栏、列宽、首页、动态红点、主题、字号、图片、帧率等',
|
||||
icon: Icons.style_outlined,
|
||||
icon: Icon(Icons.style_outlined),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.extraSetting,
|
||||
subtitle: '震动、搜索、收藏、ai、评论、动态、代理、更新检查等',
|
||||
icon: Icons.extension_outlined,
|
||||
icon: Icon(Icons.extension_outlined),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.webdavSetting,
|
||||
icon: MdiIcons.databaseCogOutline,
|
||||
icon: Icon(MdiIcons.databaseCogOutline),
|
||||
),
|
||||
_SettingsModel(
|
||||
type: SettingType.about,
|
||||
icon: Icons.info_outline,
|
||||
icon: Icon(Icons.info_outline),
|
||||
),
|
||||
];
|
||||
|
||||
@@ -180,7 +180,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
(item) => ListTile(
|
||||
tileColor: _getTileColor(theme, item.type),
|
||||
onTap: () => _toPage(item.type),
|
||||
leading: Icon(item.icon),
|
||||
leading: item.icon,
|
||||
title: Text(item.type.title, style: titleStyle),
|
||||
subtitle: item.subtitle == null
|
||||
? null
|
||||
@@ -204,7 +204,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
ListTile(
|
||||
tileColor: _getTileColor(theme, _items.last.type),
|
||||
onTap: () => _toPage(_items.last.type),
|
||||
leading: Icon(_items.last.icon),
|
||||
leading: _items.last.icon,
|
||||
title: Text(_items.last.type.title, style: titleStyle),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -98,8 +98,7 @@ class _SharePanelState extends State<SharePanel> {
|
||||
size: 32,
|
||||
iconSize: 18,
|
||||
tooltip: '关闭',
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: Get.back,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -176,14 +176,19 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
child: Obx(() {
|
||||
final isFav = introController.isFav.value;
|
||||
return iconButton(
|
||||
context: context,
|
||||
size: 28,
|
||||
iconSize: 26,
|
||||
tooltip: '${isFav ? '取消' : ''}收藏',
|
||||
onPressed: () => introController.onFavPugv(isFav),
|
||||
icon: isFav ? Icons.star_rounded : Icons.star_border_rounded,
|
||||
bgColor: isFav ? null : theme.colorScheme.onInverseSurface,
|
||||
iconColor: isFav ? null : theme.colorScheme.onSurfaceVariant,
|
||||
icon: isFav
|
||||
? const Icon(Icons.star_rounded)
|
||||
: const Icon(Icons.star_border_rounded),
|
||||
bgColor: isFav
|
||||
? theme.colorScheme.secondaryContainer
|
||||
: theme.colorScheme.onInverseSurface,
|
||||
iconColor: isFav
|
||||
? theme.colorScheme.onSecondaryContainer
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
}),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/keep_alive_wrapper.dart';
|
||||
import 'package:PiliPlus/common/widgets/page/tabs.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
@@ -70,14 +69,12 @@ class _IntroDetailState extends State<PgcIntroPanel>
|
||||
},
|
||||
),
|
||||
),
|
||||
iconButton(
|
||||
context: context,
|
||||
icon: Icons.clear,
|
||||
IconButton(
|
||||
tooltip: '关闭',
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: Get.back,
|
||||
iconSize: 22,
|
||||
bgColor: Colors.transparent,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const SizedBox(width: 2),
|
||||
],
|
||||
),
|
||||
children: [
|
||||
|
||||
@@ -75,19 +75,19 @@ class _MediaListPanelState extends State<MediaListPanel>
|
||||
title: Text(widget.panelTitle ?? '稍后再看'),
|
||||
backgroundColor: Colors.transparent,
|
||||
actions: [
|
||||
mediumButton(
|
||||
iconButton(
|
||||
tooltip: widget.desc ? '顺序播放' : '倒序播放',
|
||||
icon: widget.desc
|
||||
? MdiIcons.sortAscending
|
||||
: MdiIcons.sortDescending,
|
||||
? const Icon(MdiIcons.sortAscending)
|
||||
: const Icon(MdiIcons.sortDescending),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
widget.onReverse();
|
||||
},
|
||||
),
|
||||
mediumButton(
|
||||
iconButton(
|
||||
tooltip: '关闭',
|
||||
icon: Icons.close,
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: Get.back,
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
|
||||
@@ -89,7 +89,7 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
||||
context: context,
|
||||
onPressed: Get.back,
|
||||
tooltip: '关闭',
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
size: 32,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:PiliPlus/common/skeleton/video_reply.dart';
|
||||
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||
@@ -72,14 +71,12 @@ class _NoteListPageState extends State<NoteListPage>
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
iconButton(
|
||||
context: context,
|
||||
IconButton(
|
||||
tooltip: '关闭',
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: Get.back,
|
||||
size: 32,
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const SizedBox(width: 2),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -76,7 +76,7 @@ class PostPanel extends CommonSlidePage {
|
||||
context: context,
|
||||
size: 26,
|
||||
tooltip: '设为当前',
|
||||
icon: Icons.my_location,
|
||||
icon: const Icon(Icons.my_location),
|
||||
onPressed: () {
|
||||
updateSegment(
|
||||
isFirst: isFirst,
|
||||
@@ -90,7 +90,9 @@ class PostPanel extends CommonSlidePage {
|
||||
context: context,
|
||||
size: 26,
|
||||
tooltip: isFirst ? '视频开头' : '视频结尾',
|
||||
icon: isFirst ? Icons.first_page : Icons.last_page,
|
||||
icon: isFirst
|
||||
? const Icon(Icons.first_page)
|
||||
: const Icon(Icons.last_page),
|
||||
onPressed: () {
|
||||
updateSegment(
|
||||
isFirst: isFirst,
|
||||
@@ -104,7 +106,7 @@ class PostPanel extends CommonSlidePage {
|
||||
context: context,
|
||||
size: 26,
|
||||
tooltip: '编辑',
|
||||
icon: Icons.edit,
|
||||
icon: const Icon(Icons.edit),
|
||||
onPressed: () async {
|
||||
final res = await showDialog<String>(
|
||||
context: context,
|
||||
@@ -222,7 +224,7 @@ class _PostPanelState extends State<PostPanel>
|
||||
);
|
||||
});
|
||||
},
|
||||
icon: Icons.add,
|
||||
icon: const Icon(Icons.add),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
iconButton(
|
||||
@@ -230,7 +232,7 @@ class _PostPanelState extends State<PostPanel>
|
||||
context: context,
|
||||
tooltip: '关闭',
|
||||
onPressed: Get.back,
|
||||
icon: Icons.close,
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
@@ -494,7 +496,7 @@ class _PostPanelState extends State<PostPanel>
|
||||
context: context,
|
||||
size: 26,
|
||||
tooltip: '移除',
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
list.removeAt(index);
|
||||
@@ -509,7 +511,7 @@ class _PostPanelState extends State<PostPanel>
|
||||
context: context,
|
||||
size: 26,
|
||||
tooltip: '预览',
|
||||
icon: Icons.preview_outlined,
|
||||
icon: const Icon(Icons.preview_outlined),
|
||||
onPressed: () async {
|
||||
final videoCtr = widget.plPlayerController.videoPlayerController;
|
||||
if (videoCtr != null) {
|
||||
|
||||
@@ -334,16 +334,14 @@ class _SendDanmakuPanelState extends CommonTextPubPageState<SendDanmakuPanel> {
|
||||
() {
|
||||
final isEmoji = panelType.value == PanelType.emoji;
|
||||
return iconButton(
|
||||
context: context,
|
||||
tooltip: '弹幕样式',
|
||||
onPressed: () {
|
||||
updatePanelType(
|
||||
isEmoji ? PanelType.keyboard : PanelType.emoji,
|
||||
);
|
||||
},
|
||||
bgColor: Colors.transparent,
|
||||
iconSize: 24,
|
||||
icon: Icons.text_format,
|
||||
icon: const Icon(Icons.text_format),
|
||||
iconColor: isEmoji
|
||||
? themeData.colorScheme.primary
|
||||
: themeData.colorScheme.onSurfaceVariant,
|
||||
@@ -393,30 +391,26 @@ class _SendDanmakuPanelState extends CommonTextPubPageState<SendDanmakuPanel> {
|
||||
Obx(
|
||||
() => enablePublish.value
|
||||
? iconButton(
|
||||
context: context,
|
||||
bgColor: Colors.transparent,
|
||||
iconSize: 22,
|
||||
iconColor: themeData.colorScheme.onSurfaceVariant,
|
||||
onPressed: () {
|
||||
editController.clear();
|
||||
enablePublish.value = false;
|
||||
},
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Obx(
|
||||
() => iconButton(
|
||||
context: context,
|
||||
tooltip: '发送',
|
||||
bgColor: Colors.transparent,
|
||||
iconSize: 22,
|
||||
iconColor: enablePublish.value
|
||||
? themeData.colorScheme.primary
|
||||
: themeData.colorScheme.outline,
|
||||
onPressed: enablePublish.value ? onPublish : null,
|
||||
icon: Icons.send,
|
||||
icon: const Icon(Icons.send),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -62,7 +62,7 @@ class _ViewPointsPageState extends State<ViewPointsPage>
|
||||
iconButton(
|
||||
context: context,
|
||||
size: 30,
|
||||
icon: Icons.clear,
|
||||
icon: const Icon(Icons.clear),
|
||||
tooltip: '关闭',
|
||||
onPressed: Get.back,
|
||||
),
|
||||
|
||||
@@ -1373,9 +1373,8 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
bool isDanmaku = true,
|
||||
}) {
|
||||
return iconButton(
|
||||
context: context,
|
||||
tooltip: '默认值: $def',
|
||||
icon: Icons.refresh,
|
||||
icon: const Icon(Icons.refresh),
|
||||
onPressed: () {
|
||||
onPressed();
|
||||
if (isDanmaku) {
|
||||
@@ -1384,7 +1383,6 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
plPlayerController.putSubtitleSettings();
|
||||
}
|
||||
},
|
||||
bgColor: Colors.transparent,
|
||||
iconColor: theme.colorScheme.outline,
|
||||
size: 24,
|
||||
iconSize: 24,
|
||||
@@ -1943,16 +1941,23 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
SliverPersistentHeader(
|
||||
pinned: true,
|
||||
delegate: CustomSliverPersistentHeaderDelegate(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 14,
|
||||
vertical: 7,
|
||||
child: Container(
|
||||
height: 45,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: theme.colorScheme.outline.withValues(
|
||||
alpha: 0.1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('弹幕列表'),
|
||||
IconButton(
|
||||
iconButton(
|
||||
onPressed: () => setState(() {}),
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
@@ -1965,6 +1970,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
?_buildDanmakuList(ctr.staticDanmaku),
|
||||
?_buildDanmakuList(ctr.scrollDanmaku),
|
||||
?_buildDanmakuList(ctr.specialDanmaku),
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 12)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -1985,12 +1991,15 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
dense: true,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 14),
|
||||
onLongPress: () => Utils.copyText(item.content.text),
|
||||
title: Text(item.content.text),
|
||||
title: Text(
|
||||
item.content.text,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Builder(
|
||||
builder: (context) => IconButton(
|
||||
builder: (context) => iconButton(
|
||||
onPressed: () async {
|
||||
if (await HeaderControl.likeDanmaku(
|
||||
extra,
|
||||
@@ -2006,7 +2015,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
if (item.content.selfSend)
|
||||
IconButton(
|
||||
iconButton(
|
||||
onPressed: () => HeaderControl.deleteDanmaku(
|
||||
extra.id,
|
||||
plPlayerController.cid!,
|
||||
@@ -2014,7 +2023,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
icon: const Icon(Icons.delete_outline),
|
||||
)
|
||||
else
|
||||
IconButton(
|
||||
iconButton(
|
||||
onPressed: () => HeaderControl.reportDanmaku(
|
||||
extra,
|
||||
context,
|
||||
|
||||
Reference in New Issue
Block a user