Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-18 12:02:42 +08:00
parent 8e4824ab6f
commit 3d4aa7d5a9
13 changed files with 71 additions and 76 deletions

View File

@@ -153,7 +153,7 @@ abstract class CommonIntroController extends GetxController
final res = await (hasLater.value
? UserHttp.toViewDel(aids: IdUtils.bv2av(bvid).toString())
: UserHttp.toViewLater(bvid: bvid));
if (res.isSuccess) hasLater.value = !hasLater.value;
if (res.isSuccess) hasLater.toggle();
}
}
@@ -239,7 +239,7 @@ mixin FavMixin on TripleMixin {
SmartDialog.dismiss();
if (result.isSuccess) {
updateFavCount(hasFav ? -1 : 1);
this.hasFav.value = !hasFav;
this.hasFav.toggle();
SmartDialog.showToast('${hasFav ? '取消' : ''}收藏成功');
} else {
res.toast();

View File

@@ -68,18 +68,13 @@ TextSpan? richNode(
if (i.origText == _linkFoldedText) {
item.linkFolded = true;
}
spanChildren.add(
TextSpan(
text: i.origText,
style: const TextStyle(height: 1.65),
),
);
spanChildren.add(TextSpan(text: i.origText));
break;
// @用户
case 'RICH_TEXT_NODE_TYPE_AT':
spanChildren.add(
TextSpan(
text: ' ${i.text}',
text: '${spanChildren.isNotEmpty ? ' ' : ''}${i.text}',
style: style,
recognizer: NoDeadlineTapGestureRecognizer()
..onTap = () => Get.toNamed('/member?mid=${i.rid}'),
@@ -365,7 +360,10 @@ TextSpan? richNode(
break;
}
}
return TextSpan(children: spanChildren);
return TextSpan(
children: spanChildren,
style: const TextStyle(height: 1.65),
);
}
} catch (err) {
if (kDebugMode) debugPrint('❌rich_node_panel err: $err');

View File

@@ -109,7 +109,7 @@ class DynTopicController
} else {
topState.value.data!.topicItem!.fav += 1;
}
this.isFav.value = !isFav;
this.isFav.toggle();
} else {
res.toast();
}
@@ -128,7 +128,7 @@ class DynTopicController
} else {
topState.value.data!.topicItem!.like += 1;
}
this.isLike.value = !isLike;
this.isLike.toggle();
} else {
res.toast();
}

View File

@@ -421,14 +421,15 @@ class _DynTopicPageState extends State<DynTopicPage>
Widget _buildFoldItem(FoldCardItem item) {
return Padding(
padding: const .only(top: 12),
child: InkWell(
onTap: _controller.topicFold,
child: Ink(
padding: const .symmetric(vertical: 10),
color: colorScheme.outline.withValues(alpha: .05),
child: Center(
child: Material(
color: colorScheme.outline.withValues(alpha: .05),
child: InkWell(
onTap: _controller.topicFold,
child: Padding(
padding: const .symmetric(vertical: 10),
child: Row(
mainAxisSize: .min,
mainAxisAlignment: .center,
children: [
Text(item.foldDesc!),
const Icon(Icons.keyboard_arrow_right, size: 22),

View File

@@ -61,13 +61,13 @@ class LiveAreaController extends CommonListController<List<AreaList>?, AreaList>
ids: response.map((e) => e.id).join(','),
);
if (res.isSuccess) {
isEditing.value = !isEditing.value;
isEditing.toggle();
SmartDialog.showToast('设置成功');
} else {
res.toast();
}
} else {
isEditing.value = !isEditing.value;
isEditing.toggle();
}
}
@@ -75,7 +75,7 @@ class LiveAreaController extends CommonListController<List<AreaList>?, AreaList>
if (isEditing.value) {
setFavTag();
} else {
isEditing.value = !isEditing.value;
isEditing.toggle();
}
}

View File

@@ -244,18 +244,23 @@ class _SuperChatCardState extends State<SuperChatCard> {
color: bottomColor,
),
padding: const .all(8),
child: SelectableText(
item.message,
selectionColor: Colors.black26,
scrollPhysics: const NeverSelectableScrollPhysics(),
style: TextStyle(
color: ColourUtils.parseColor(item.messageFontColor),
decoration: widget.persistentSC && item.deleted
? .lineThrough
: null,
decorationThickness: 1.5,
decorationStyle: .double,
decorationColor: Colors.white,
child: TextSelectionTheme(
data: TextSelectionThemeData(
selectionHandleColor: Color.lerp(bottomColor, Colors.white, .26),
),
child: SelectableText(
item.message,
scrollPhysics: const NeverSelectableScrollPhysics(),
selectionColor: Color.lerp(bottomColor, Colors.black, .26),
style: TextStyle(
color: ColourUtils.parseColor(item.messageFontColor),
// decoration: widget.persistentSC && item.deleted
// ? .lineThrough
// : null,
// decorationThickness: 1.5,
// decorationStyle: .double,
// decorationColor: Colors.white,
),
),
),
),

View File

@@ -184,28 +184,25 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
),
),
Obx(
() {
final onlyPlayAudio = plPlayerController.onlyPlayAudio.value;
return ComBtn(
height: 30,
tooltip: '仅播放音频',
onTap: () {
plPlayerController.onlyPlayAudio.value = !onlyPlayAudio;
widget.onPlayAudio();
},
icon: onlyPlayAudio
? const Icon(
size: 18,
MdiIcons.musicCircle,
color: Colors.white,
)
: const Icon(
size: 18,
MdiIcons.musicCircleOutline,
color: Colors.white,
),
);
},
() => ComBtn(
height: 30,
tooltip: '仅播放音频',
onTap: () {
plPlayerController.onlyPlayAudio.toggle();
widget.onPlayAudio();
},
icon: plPlayerController.onlyPlayAudio.value
? const Icon(
size: 18,
MdiIcons.musicCircle,
color: Colors.white,
)
: const Icon(
size: 18,
MdiIcons.musicCircleOutline,
color: Colors.white,
),
),
),
if (PlatformUtils.isMobile)
Obx(() {

View File

@@ -197,11 +197,11 @@ class _PgcIndexPageState extends State<PgcIndexPage>
if (count > 5) ...[
const SizedBox(height: 8),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _ctr.isExpand.value = !_ctr.isExpand.value,
behavior: .opaque,
onTap: _ctr.isExpand.toggle,
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisSize: .min,
children: [
Text(
_ctr.isExpand.value ? '收起' : '展开',

View File

@@ -154,8 +154,8 @@ class _PgcReviewPostPanelState extends State<PgcReviewPostPanel> {
Padding(
padding: const EdgeInsets.only(left: 12, right: 12, bottom: 12),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => _shareFeed.value = !_shareFeed.value,
behavior: .opaque,
onTap: _shareFeed.toggle,
child: Obx(
() {
final shareFeed = _shareFeed.value;
@@ -163,7 +163,7 @@ class _PgcReviewPostPanelState extends State<PgcReviewPostPanel> {
? theme.colorScheme.primary
: theme.colorScheme.outline;
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisSize: .min,
children: [
Icon(
size: 22,
@@ -172,10 +172,7 @@ class _PgcReviewPostPanelState extends State<PgcReviewPostPanel> {
: Icons.check_box_outline_blank_outlined,
color: color,
),
Text(
' 分享到动态',
style: TextStyle(color: color),
),
Text(' 分享到动态', style: TextStyle(color: color)),
],
);
},

View File

@@ -472,7 +472,7 @@ class PgcIntroController extends CommonIntroController {
? await FavHttp.delFavPugv(seasonId!)
: await FavHttp.addFavPugv(seasonId!);
if (res.isSuccess) {
this.isFav.value = !isFav;
this.isFav.toggle();
SmartDialog.showToast('${isFav ? '取消' : ''}收藏成功');
} else {
res.toast();

View File

@@ -94,7 +94,7 @@ class WhisperLinkSettingController extends GetxController {
? await ImGrpc.unpinSession(sessionId: sessionId)
: await ImGrpc.pinSession(sessionId: sessionId);
if (res.isSuccess) {
isPinned.value = !isPinned.value;
isPinned.toggle();
} else {
res.toast();
}