|
|
@ -6,7 +6,6 @@ import 'package:aku_new_community/constants/saas_api.dart';
|
|
|
|
import 'package:aku_new_community/model/common/img_model.dart';
|
|
|
|
import 'package:aku_new_community/model/common/img_model.dart';
|
|
|
|
import 'package:aku_new_community/models/community/all_dynamic_list_model.dart';
|
|
|
|
import 'package:aku_new_community/models/community/all_dynamic_list_model.dart';
|
|
|
|
import 'package:aku_new_community/provider/user_provider.dart';
|
|
|
|
import 'package:aku_new_community/provider/user_provider.dart';
|
|
|
|
import 'package:aku_new_community/ui/community/community_func.dart';
|
|
|
|
|
|
|
|
import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart';
|
|
|
|
import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart';
|
|
|
|
import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart';
|
|
|
|
import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart';
|
|
|
|
import 'package:aku_new_community/utils/bee_date_util.dart';
|
|
|
|
import 'package:aku_new_community/utils/bee_date_util.dart';
|
|
|
@ -26,7 +25,7 @@ import 'package:velocity_x/velocity_x.dart';
|
|
|
|
class ChatCard extends StatefulWidget {
|
|
|
|
class ChatCard extends StatefulWidget {
|
|
|
|
final AllDynamicListModel model;
|
|
|
|
final AllDynamicListModel model;
|
|
|
|
final VoidCallback? onDelete;
|
|
|
|
final VoidCallback? onDelete;
|
|
|
|
final VoidCallback? onBack;
|
|
|
|
|
|
|
|
final bool hideLine;
|
|
|
|
final bool hideLine;
|
|
|
|
final bool canTap;
|
|
|
|
final bool canTap;
|
|
|
|
|
|
|
|
|
|
|
@ -35,7 +34,7 @@ class ChatCard extends StatefulWidget {
|
|
|
|
required this.model,
|
|
|
|
required this.model,
|
|
|
|
this.onDelete,
|
|
|
|
this.onDelete,
|
|
|
|
this.hideLine = false,
|
|
|
|
this.hideLine = false,
|
|
|
|
this.canTap = true, this.onBack,
|
|
|
|
this.canTap = true,
|
|
|
|
}) : super(key: key);
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
@ -143,21 +142,24 @@ class _ChatCardState extends State<ChatCard> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
20.wb,
|
|
|
|
20.wb,
|
|
|
|
Material(
|
|
|
|
GestureDetector(
|
|
|
|
color: Colors.transparent,
|
|
|
|
onTap: widget.model.isComment == 1 ? () async {} : () async {},
|
|
|
|
child: Row(
|
|
|
|
child: Material(
|
|
|
|
children: [
|
|
|
|
color: Colors.transparent,
|
|
|
|
Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
|
|
|
|
child: Row(
|
|
|
|
width: 32.w,
|
|
|
|
children: [
|
|
|
|
height: 32.w,
|
|
|
|
Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
|
|
|
|
color: Colors.black.withOpacity(0.45)),
|
|
|
|
width: 32.w,
|
|
|
|
5.wb,
|
|
|
|
height: 32.w,
|
|
|
|
'${widget.model.commentNum}'
|
|
|
|
color: Colors.black.withOpacity(0.45)),
|
|
|
|
.text
|
|
|
|
5.wb,
|
|
|
|
.size(24.sp)
|
|
|
|
'${widget.model.commentNum}'
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
.text
|
|
|
|
.make(),
|
|
|
|
.size(24.sp)
|
|
|
|
],
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -174,7 +176,6 @@ class _ChatCardState extends State<ChatCard> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
|
|
return DecoratedBox(
|
|
|
|
return DecoratedBox(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
@ -183,19 +184,10 @@ class _ChatCardState extends State<ChatCard> {
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
onPressed: widget.canTap
|
|
|
|
onPressed: widget.canTap
|
|
|
|
? () async {
|
|
|
|
? () async {
|
|
|
|
|
|
|
|
Get.to(() => EventDetailPage(
|
|
|
|
var result =
|
|
|
|
|
|
|
|
await Get.to(() => EventDetailPage(
|
|
|
|
|
|
|
|
dynamicId: widget.model.id,
|
|
|
|
dynamicId: widget.model.id,
|
|
|
|
onDelete: widget.onDelete,
|
|
|
|
onDelete: widget.onDelete,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
CommunityFunc.dynamicAddViews(widget.model.id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result != null && result) {
|
|
|
|
|
|
|
|
widget.onBack!();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
@ -272,8 +264,11 @@ class _ChatCardState extends State<ChatCard> {
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
if (result == true) {
|
|
|
|
if (result == true) {
|
|
|
|
|
|
|
|
await NetUtil().get(
|
|
|
|
await CommunityFunc.deleteDynamicAddViews(widget.model.id);
|
|
|
|
API.community.deleteMyEvent,
|
|
|
|
|
|
|
|
params: {'themeId': widget.model.id},
|
|
|
|
|
|
|
|
showMessage: true,
|
|
|
|
|
|
|
|
);
|
|
|
|
if (widget.onDelete != null) widget.onDelete!();
|
|
|
|
if (widget.onDelete != null) widget.onDelete!();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|