feat: new reply page

This commit is contained in:
bggRGjQaUbCoE
2024-09-02 12:19:11 +08:00
parent 92b966970b
commit b7c7f3743d
9 changed files with 628 additions and 130 deletions

View File

@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:get/get_navigation/src/dialog/dialog_route.dart';
import 'package:hive/hive.dart';
import 'package:PiliPalaX/common/widgets/badge.dart';
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
@@ -11,12 +12,12 @@ import 'package:PiliPalaX/models/common/reply_type.dart';
import 'package:PiliPalaX/models/video/reply/item.dart';
import 'package:PiliPalaX/pages/preview/index.dart';
import 'package:PiliPalaX/pages/video/detail/index.dart';
import 'package:PiliPalaX/pages/video/detail/reply_new/index.dart';
import 'package:PiliPalaX/utils/feed_back.dart';
import 'package:PiliPalaX/utils/storage.dart';
import 'package:PiliPalaX/utils/url_utils.dart';
import 'package:PiliPalaX/utils/utils.dart';
import '../../../../../utils/app_scheme.dart';
import '../../reply_new/reply_page.dart';
import 'zan.dart';
Box setting = GStorage.setting;
@@ -302,28 +303,68 @@ class ReplyItem extends StatelessWidget {
child: TextButton(
onPressed: () {
feedBack();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (builder) {
return VideoReplyNewDialog(
oid: replyItem!.oid,
root: replyItem!.rpid,
parent: replyItem!.rpid,
replyType: replyType,
replyItem: replyItem,
);
},
).then((value) => {
// 完成评论,数据添加
if (value != null &&
value['data'] != null &&
addReply != null)
{
addReply?.call(value['data'])
// replyControl.replies.add(value['data']),
}
});
Navigator.of(context)
.push(
GetDialogRoute(
pageBuilder:
(buildContext, animation, secondaryAnimation) {
return ReplyPage(
oid: replyItem!.oid,
root: replyItem!.rpid,
parent: replyItem!.rpid,
replyType: replyType,
replyItem: replyItem,
);
},
transitionDuration: const Duration(milliseconds: 500),
transitionBuilder:
(context, animation, secondaryAnimation, child) {
const begin = Offset(0.0, 1.0);
const end = Offset.zero;
const curve = Curves.linear;
var tween = Tween(begin: begin, end: end)
.chain(CurveTween(curve: curve));
return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
),
)
.then((value) => {
// 完成评论,数据添加
if (value != null &&
value['data'] != null &&
addReply != null)
{
addReply?.call(value['data'])
// replyControl.replies.add(value['data']),
}
});
// showModalBottomSheet(
// context: context,
// isScrollControlled: true,
// builder: (builder) {
// return VideoReplyNewDialog(
// oid: replyItem!.oid,
// root: replyItem!.rpid,
// parent: replyItem!.rpid,
// replyType: replyType,
// replyItem: replyItem,
// );
// },
// ).then((value) => {
// // 完成评论,数据添加
// if (value != null &&
// value['data'] != null &&
// addReply != null)
// {
// addReply?.call(value['data'])
// // replyControl.replies.add(value['data']),
// }
// });
},
child: Row(children: [
Icon(Icons.reply,