|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
|
|
import 'dart:ui'; |
|
|
|
|
|
|
|
|
|
import 'package:chewie/chewie.dart'; |
|
|
|
@ -15,10 +15,8 @@ import 'package:huixiang/view_widget/custom_image.dart';
|
|
|
|
|
import 'package:huixiang/view_widget/icon_text.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/round_button.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:path_provider/path_provider.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:video_player/video_player.dart'; |
|
|
|
|
import 'package:thumbnails/thumbnails.dart'; |
|
|
|
|
|
|
|
|
|
class CommunityDynamic extends StatefulWidget { |
|
|
|
|
final int itemCount; |
|
|
|
@ -29,6 +27,7 @@ class CommunityDynamic extends StatefulWidget {
|
|
|
|
|
final Function exitFull; |
|
|
|
|
final bool isList; |
|
|
|
|
final ComunityComment comment; |
|
|
|
|
final String userId; |
|
|
|
|
|
|
|
|
|
CommunityDynamic( |
|
|
|
|
this.comment, |
|
|
|
@ -39,6 +38,7 @@ class CommunityDynamic extends StatefulWidget {
|
|
|
|
|
this.isDetails = false, |
|
|
|
|
this.removalDynamic, |
|
|
|
|
this.exitFull, |
|
|
|
|
this.userId, |
|
|
|
|
this.isList = false, |
|
|
|
|
}) : super(key: key); |
|
|
|
|
|
|
|
|
@ -57,6 +57,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
ChewieController chewieAudioController; |
|
|
|
|
Chewie chewies; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
@ -114,6 +115,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
_vipFollow(followId) async { |
|
|
|
|
BaseData baseData = await apiService.follow(followId); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
widget.exitFull(); |
|
|
|
|
SmartDialog.showToast("关注成功", alignment: Alignment.center); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
@ -183,15 +185,15 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
Text( |
|
|
|
|
widget?.comment?.memberInfo?.nickname ?? "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: MyFontWeight.medium, |
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Text( |
|
|
|
|
widget?.comment?.createTime ?? "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontSize: 13.sp, |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
color: Color(0xFF808080), |
|
|
|
|
), |
|
|
|
@ -201,6 +203,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
if(widget.comment.memberInfo.mid != widget.userId??"") |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
@ -213,12 +216,17 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: (widget.commentType == 0) |
|
|
|
|
? RoundButton( |
|
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
|
horizontal: 8, |
|
|
|
|
vertical: 3, |
|
|
|
|
child: (widget.commentType == 0 |
|
|
|
|
) |
|
|
|
|
? Container( |
|
|
|
|
width: 56.w, |
|
|
|
|
height: 21.h, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius: BorderRadius.circular(11.w), |
|
|
|
|
color: Color(0xFF32A060), |
|
|
|
|
), |
|
|
|
|
child: RoundButton( |
|
|
|
|
backgroup: (widget.comment.selfFollow ?? false) |
|
|
|
|
? Color(0xFFE6E6E6) |
|
|
|
|
: Color(0xFF32A060), |
|
|
|
@ -236,9 +244,9 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
color: (widget.comment.selfFollow ?? false) |
|
|
|
|
? Color(0xFF808080) |
|
|
|
|
: Colors.white, |
|
|
|
|
size: 14, |
|
|
|
|
size: 15, |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
)) |
|
|
|
|
: Icon( |
|
|
|
|
Icons.close, |
|
|
|
|
color: Colors.black, |
|
|
|
@ -257,7 +265,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
style: TextStyle( |
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
buildMedia(widget.comment.subjectInfo), |
|
|
|
@ -284,12 +292,17 @@ class _CommunityDynamic extends State<CommunityDynamic> {
|
|
|
|
|
leftImage: "assets/svg/pinglun.svg", |
|
|
|
|
iconSize: 16, |
|
|
|
|
), |
|
|
|
|
IconText( |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
child: IconText( |
|
|
|
|
"${widget.comment.likes ?? 0}", |
|
|
|
|
space: 4.w, |
|
|
|
|
leftImage: "assets/svg/xihuan.svg", |
|
|
|
|
iconSize: 16, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|