diff --git a/lib/http/video.dart b/lib/http/video.dart index 9e1cac10f..c9cad789c 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -759,6 +759,7 @@ class VideoHttp { int? root, int? parent, List? pictures, + bool? syncToDynamic, }) async { if (message == '') { return {'status': false, 'data': [], 'msg': '请输入评论内容'}; @@ -766,10 +767,11 @@ class VideoHttp { Map data = { 'type': type.index, 'oid': oid, - 'root': root == null || root == 0 ? '' : root, - 'parent': parent == null || parent == 0 ? '' : parent, + if (root != null && root != 0) 'root': root, + if (parent != null && parent != 0) 'parent': parent, 'message': message, if (pictures != null) 'pictures': jsonEncode(pictures), + if (syncToDynamic == true) 'sync_to_dynamic': 1, 'csrf': await Request.getCsrf(), }; var res = await Request().post( diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index f22bc8eb2..c0c01a77e 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -306,6 +306,25 @@ class AuthorPanel extends StatelessWidget { }, minLeadingWidth: 0, ), + if (GStorage.isLogin) + ListTile( + title: Text( + '举报', + style: Theme.of(context).textTheme.titleSmall!.copyWith( + color: Theme.of(context).colorScheme.error, + ), + ), + leading: Icon( + Icons.error_outline_outlined, + size: 19, + color: Theme.of(context).colorScheme.error, + ), + onTap: () { + Get.back(); + _showReportDynDialog(context); + }, + minLeadingWidth: 0, + ), if (item.modules.moduleAuthor.mid == GStorage.userInfo.get('userInfoCache')?.mid && onRemove != null) @@ -345,25 +364,6 @@ class AuthorPanel extends StatelessWidget { .titleSmall! .copyWith(color: Theme.of(context).colorScheme.error)), ), - if (GStorage.isLogin) - ListTile( - title: Text( - '举报', - style: Theme.of(context).textTheme.titleSmall!.copyWith( - color: Theme.of(context).colorScheme.error, - ), - ), - leading: Icon( - Icons.error_outline_outlined, - size: 19, - color: Theme.of(context).colorScheme.error, - ), - onTap: () { - Get.back(); - _showReportDynDialog(context); - }, - minLeadingWidth: 0, - ), const Divider(thickness: 0.1, height: 1), ListTile( onTap: Get.back, diff --git a/lib/pages/video/detail/reply_new/reply_page.dart b/lib/pages/video/detail/reply_new/reply_page.dart index 7f7567663..ceeafcf91 100644 --- a/lib/pages/video/detail/reply_new/reply_page.dart +++ b/lib/pages/video/detail/reply_new/reply_page.dart @@ -34,6 +34,8 @@ class ReplyPage extends CommonPublishPage { } class _ReplyPageState extends CommonPublishPageState { + RxBool _syncToDynamic = false.obs; + @override Widget build(BuildContext context) { return MediaQuery.removePadding( @@ -177,7 +179,7 @@ class _ReplyPageState extends CommonPublishPageState { selected: selectKeyboard.value, ), ), - const SizedBox(width: 20), + const SizedBox(width: 10), Obx( () => ToolbarIconButton( tooltip: '表情', @@ -192,7 +194,7 @@ class _ReplyPageState extends CommonPublishPageState { ), ), if (widget.root == 0) ...[ - const SizedBox(width: 20), + const SizedBox(width: 10), ToolbarIconButton( tooltip: '图片', selected: false, @@ -201,6 +203,32 @@ class _ReplyPageState extends CommonPublishPageState { ), ], const Spacer(), + Obx( + () => TextButton.icon( + style: TextButton.styleFrom( + padding: const EdgeInsets.symmetric( + horizontal: 15, vertical: 13), + visualDensity: const VisualDensity( + horizontal: -2, + vertical: -2, + ), + foregroundColor: _syncToDynamic.value + ? Theme.of(context).colorScheme.secondary + : Theme.of(context).colorScheme.outline, + ), + onPressed: () { + _syncToDynamic.value = !_syncToDynamic.value; + }, + icon: Icon( + _syncToDynamic.value + ? Icons.check_box + : Icons.check_box_outline_blank, + size: 22, + ), + label: const Text('转发至动态'), + ), + ), + const Spacer(), Obx( () => FilledButton.tonal( onPressed: enablePublish.value ? onPublish : null, @@ -234,6 +262,7 @@ class _ReplyPageState extends CommonPublishPageState { ? ' 回复 @${GlobalData().grpcReply ? widget.replyItem.member.name : widget.replyItem.member.uname} : $message' : message, pictures: pictures, + syncToDynamic: _syncToDynamic.value, ); if (result['status']) { SmartDialog.showToast(result['data']['success_toast']);