Browse Source

消息更改

dart3_last
wurong 2 years ago
parent
commit
ba718c6ecd
  1. 2
      android/app/build.gradle
  2. 324
      lib/message/system_details.dart
  3. 1
      lib/message/system_message.dart
  4. 300
      pubspec.lock
  5. 4
      pubspec.yaml

2
android/app/build.gradle

@ -184,7 +184,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' // implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5'
implementation fileTree(include: ['*.aar'], dir: 'libs') implementation fileTree(include: ['*.aar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'

324
lib/message/system_details.dart

@ -23,6 +23,7 @@ class SystemDetails extends StatefulWidget {
final Map<String, dynamic> arguments; final Map<String, dynamic> arguments;
SystemDetails({this.arguments}); SystemDetails({this.arguments});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _SystemDetails(); return _SystemDetails();
@ -34,6 +35,7 @@ class _SystemDetails extends State<SystemDetails> {
int pageNum = 1; int pageNum = 1;
List<Message> messages = []; List<Message> messages = [];
int msgType = 0; int msgType = 0;
// String parenId = "0"; // String parenId = "0";
var commentFocus = FocusNode(); var commentFocus = FocusNode();
String hintText = S.current.liuxianinjingcaidepinglunba; String hintText = S.current.liuxianinjingcaidepinglunba;
@ -43,7 +45,6 @@ class _SystemDetails extends State<SystemDetails> {
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
int indexMsg = 0; int indexMsg = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -56,7 +57,6 @@ class _SystemDetails extends State<SystemDetails> {
}); });
} }
_refresh() { _refresh() {
pageNum = 1; pageNum = 1;
queryMessage(); queryMessage();
@ -93,12 +93,13 @@ class _SystemDetails extends State<SystemDetails> {
} }
//// ////
_vipFollow(followId,isFollow) async { _vipFollow(followId, isFollow) async {
BaseData baseData = await apiService.follow(followId); BaseData baseData = await apiService.follow(followId);
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
// widget.refresh(); // widget.refresh();
queryMessage(); queryMessage();
SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center); SmartDialog.showToast(isFollow ? "取关成功" : "关注成功",
alignment: Alignment.center);
} else { } else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
@ -117,16 +118,15 @@ class _SystemDetails extends State<SystemDetails> {
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService.memberComment({
"content": content, "content": content,
"parentId": messageRelational["additionId"].toString(), "parentId": messageRelational["additionId"].toString(),
"relationalId":messageRelational["businessId"].toString(), "relationalId": messageRelational["businessId"].toString(),
"relationalType":4 "relationalType": 4
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
commentTextController.text = ""; commentTextController.text = "";
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
Navigator.of(context).pop(); Navigator.of(context).pop();
SmartDialog.showToast("发布成功", alignment: Alignment.center); SmartDialog.showToast("发布成功", alignment: Alignment.center);
} } else {
else{
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }
@ -139,11 +139,19 @@ class _SystemDetails extends State<SystemDetails> {
appBar: MyAppBar( appBar: MyAppBar(
background: Colors.white, background: Colors.white,
leadingColor: Colors.black, leadingColor: Colors.black,
title: (msgType == 2) ? S.of(context).dingdantongzhi:(msgType == 3) ? S.of(context).chongzhixiaoxi:(msgType == 4) ?"关注":(msgType == 5) ?"点赞":"评论", title: (msgType == 2)
? S.of(context).dingdantongzhi
: (msgType == 3)
? S.of(context).chongzhixiaoxi
: (msgType == 4)
? S.of(context).guanzhu
: (msgType == 5)
? S.of(context).dianzan
: S.of(context).pinglun,
titleSize: 18.sp, titleSize: 18.sp,
titleColor: Colors.black, titleColor: Colors.black,
), ),
body:SmartRefresher( body: SmartRefresher(
enablePullDown: true, enablePullDown: true,
enablePullUp: true, enablePullUp: true,
header: MyHeader(), header: MyHeader(),
@ -151,7 +159,7 @@ class _SystemDetails extends State<SystemDetails> {
footer: CustomFooter( footer: CustomFooter(
loadStyle: LoadStyle.ShowWhenLoading, loadStyle: LoadStyle.ShowWhenLoading,
builder: (BuildContext context, LoadStatus mode) { builder: (BuildContext context, LoadStatus mode) {
return (messages.length == 0)?Container():MyFooter(mode); return (messages.length == 0) ? Container() : MyFooter(mode);
}, },
), ),
controller: _refreshController, controller: _refreshController,
@ -159,24 +167,17 @@ class _SystemDetails extends State<SystemDetails> {
onLoading: () { onLoading: () {
queryMessage(); queryMessage();
}, },
child: child: Container(
Container(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: child: Container(
Container(
child: Column( child: Column(
children: [ children: [
if(msgType == 2) if (msgType == 2) orderMessage(),
orderMessage(), if (msgType == 3) rechargeMessage(),
if(msgType == 3) if (msgType == 5) fabulousMessage(),
rechargeMessage(), if (msgType == 6) commentMessage(),
if(msgType == 5) if (msgType == 4) followMessage(),
fabulousMessage(),
if(msgType == 6)
commentMessage(),
if(msgType == 4)
followMessage(),
], ],
), ),
), ),
@ -187,12 +188,13 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget orderMessage(){ Widget orderMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w), padding:
child:Column( EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -221,14 +223,13 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget orderMessageItem(Message message) { Widget orderMessageItem(Message message) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: child: Column(
Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -248,7 +249,7 @@ class _SystemDetails extends State<SystemDetails> {
height: 24.h, height: 24.h,
), ),
SizedBox( SizedBox(
width:8.w, width: 8.w,
), ),
Text( Text(
(message.typed == 1) (message.typed == 1)
@ -275,22 +276,24 @@ class _SystemDetails extends State<SystemDetails> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(left:30.w, top:20.h), margin: EdgeInsets.only(left: 30.w, top: 20.h),
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
message.content, message.content,
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
),), ),
),
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
color: Colors.black, color: Colors.black,
@ -312,18 +315,19 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget rechargeMessage(){ Widget rechargeMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w), padding:
child:Column( EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -346,14 +350,13 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget rechargeMessageItem(Message message) { Widget rechargeMessageItem(Message message) {
return Container( return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h), margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child: child: Column(
Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -373,7 +376,7 @@ class _SystemDetails extends State<SystemDetails> {
height: 24.h, height: 24.h,
), ),
SizedBox( SizedBox(
width:8.w, width: 8.w,
), ),
Text( Text(
(message.typed == 1) (message.typed == 1)
@ -400,7 +403,7 @@ class _SystemDetails extends State<SystemDetails> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(left:30.w, top:20.h), margin: EdgeInsets.only(left: 30.w, top: 20.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -413,20 +416,24 @@ class _SystemDetails extends State<SystemDetails> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
SizedBox(height:8.h,), SizedBox(
height: 8.h,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(child: Text( Expanded(
child: Text(
message.content, message.content,
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
),), ),
),
Icon( Icon(
Icons.keyboard_arrow_right, Icons.keyboard_arrow_right,
color: Colors.black, color: Colors.black,
@ -448,18 +455,18 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget fabulousMessage(){ Widget fabulousMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -476,8 +483,11 @@ class _SystemDetails extends State<SystemDetails> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/community_details', '/router/community_details',
arguments: { arguments: {
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(), "businessId":
"mid":messages[position].mid jsonDecode(messages[position].relational)[
"businessId"]
.toString(),
"mid": messages[position].mid
}, },
); );
}, },
@ -485,14 +495,13 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget fabulousMessageItem(Message message) { Widget fabulousMessageItem(Message message) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
return Container( return Container(
child: child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -505,24 +514,27 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox(width: 8,), SizedBox(
Expanded(child:Column( width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(messageRelational["nickname"] ?? "",
messageRelational["nickname"] ?? "",
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF1A1A1A)) color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
), ),
SizedBox(width:8.w,),
Text( Text(
"点赞了", "点赞了",
style:TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -530,7 +542,9 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
Text( Text(
message.updateTime, message.updateTime,
style: TextStyle( style: TextStyle(
@ -538,11 +552,13 @@ class _SystemDetails extends State<SystemDetails> {
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
), ),
), ),
SizedBox(height:12.h,), SizedBox(
height: 12.h,
),
Container( Container(
width: double.infinity, width: double.infinity,
color:Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
padding:EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -557,7 +573,7 @@ class _SystemDetails extends State<SystemDetails> {
// ), // ),
// ), // ),
MImage( MImage(
messageRelational["nickname"] , messageRelational["nickname"],
width: 38, width: 38,
height: 38, height: 38,
isCircle: true, isCircle: true,
@ -566,23 +582,25 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox(width:2.w), SizedBox(width: 2.w),
Expanded(child:Text( Expanded(
child: Text(
messageRelational["content"] ?? "", messageRelational["content"] ?? "",
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
height: 1.3, height: 1.3,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
),) ),
)
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h), margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
@ -595,18 +613,18 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget commentMessage(){ Widget commentMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -623,23 +641,25 @@ class _SystemDetails extends State<SystemDetails> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/community_details', '/router/community_details',
arguments: { arguments: {
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(), "businessId":
"mid":messages[position].mid jsonDecode(messages[position].relational)[
"businessId"]
.toString(),
"mid": messages[position].mid
}, },
); );
}, },
child: commentMessageItem(messages[position],position), child: commentMessageItem(messages[position], position),
); );
}), }),
], ],
) ));
);
} }
Widget commentMessageItem(Message message,index) {
Widget commentMessageItem(Message message, index) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
return Container( return Container(
child: child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -652,8 +672,11 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox(width: 8,), SizedBox(
Expanded(child:Column( width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -661,23 +684,24 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(messageRelational["nickname"],
messageRelational["nickname"],
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF1A1A1A)) color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
), ),
SizedBox(width:8.w,),
Text( Text(
"评论了", "评论了",
style:TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -685,7 +709,9 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
Text( Text(
message.updateTime, message.updateTime,
style: TextStyle( style: TextStyle(
@ -694,9 +720,10 @@ class _SystemDetails extends State<SystemDetails> {
), ),
), ),
], ],
),), ),
),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
setState(() { setState(() {
indexMsg = index; indexMsg = index;
showDeleteDialog(); showDeleteDialog();
@ -704,9 +731,9 @@ class _SystemDetails extends State<SystemDetails> {
}); });
}, },
child: Container( child: Container(
height:22.h, height: 22.h,
width: 40.w, width: 40.w,
padding:EdgeInsets.only(left:2,right:2), padding: EdgeInsets.only(left: 2, right: 2),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(11), borderRadius: BorderRadius.circular(11),
@ -728,7 +755,9 @@ class _SystemDetails extends State<SystemDetails> {
) )
], ],
), ),
SizedBox(height:8.h,), SizedBox(
height: 8.h,
),
// Text( // Text(
// messageRelational["content"], // messageRelational["content"],
// maxLines: 2, // maxLines: 2,
@ -785,8 +814,8 @@ class _SystemDetails extends State<SystemDetails> {
// ), // ),
Container( Container(
width: double.infinity, width: double.infinity,
color:Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
padding:EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -810,23 +839,25 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox(width:2.w), SizedBox(width: 2.w),
Expanded(child:Text( Expanded(
child: Text(
messageRelational["content"], messageRelational["content"],
maxLines: 2, maxLines: 2,
overflow:TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
height: 1.3, height: 1.3,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Color(0xFF808080), color: Color(0xFF808080),
), ),
),) ),
)
], ],
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h), margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
@ -839,18 +870,18 @@ class _SystemDetails extends State<SystemDetails> {
} }
/// ///
Widget followMessage(){ Widget followMessage() {
return Container( return Container(
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom:20.h,left: 20.w,right: 20.w), padding: EdgeInsets.only(bottom: 20.h, left: 20.w, right: 20.w),
child:Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
(messages == null || messages.length == 0) (messages == null || messages.length == 0)
? NoDataView( ? NoDataView(
src:"assets/image/icon_empty.webp", src: "assets/image/icon_empty.webp",
isShowBtn: false, isShowBtn: false,
text: S.of(context).haimeiyouxiaoxi, text: S.of(context).haimeiyouxiaoxi,
fontSize: 16.sp, fontSize: 16.sp,
@ -873,19 +904,17 @@ class _SystemDetails extends State<SystemDetails> {
); );
}), }),
], ],
) ));
);
} }
Widget followMessageItem(Message message) { Widget followMessageItem(Message message) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
if(message.relational.startsWith("{")) if (message.relational.startsWith("{"))
return Container( return Container(
child: child: Row(
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MImage( MImage(
messageRelational["avatar"], messageRelational["avatar"],
width: 44, width: 44,
@ -895,8 +924,11 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
SizedBox(width: 8,), SizedBox(
Expanded(child:Column( width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -904,23 +936,24 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded(child: Column( Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
Text( Text(messageRelational["nickname"],
messageRelational["nickname"],
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF1A1A1A)) color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
), ),
SizedBox(width:8.w,),
Text( Text(
"关注了你", "关注了你",
style:TextStyle( style: TextStyle(
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF32A060), color: Color(0xFF32A060),
@ -928,7 +961,9 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height: 8,), SizedBox(
height: 8,
),
Text( Text(
message.updateTime, message.updateTime,
style: TextStyle( style: TextStyle(
@ -937,17 +972,18 @@ class _SystemDetails extends State<SystemDetails> {
), ),
), ),
], ],
),), ),
),
GestureDetector( GestureDetector(
onTap: (){ onTap: () {
setState(() { setState(() {
_vipFollow(messageRelational["mid"].toString(),message?.followed ?? false); _vipFollow(messageRelational["mid"].toString(),
message?.followed ?? false);
}); });
}, },
child: child: RoundButton(
RoundButton(
height: 21.h, height: 21.h,
width:56.w, width: 56.w,
padding: EdgeInsets.all(2), padding: EdgeInsets.all(2),
backgroup: (message?.followed ?? false) backgroup: (message?.followed ?? false)
? Color(0xFFE6E6E6) ? Color(0xFFE6E6E6)
@ -956,12 +992,12 @@ class _SystemDetails extends State<SystemDetails> {
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
text: (message?.followed ?? false) ? "已关注" : "回关", text: (message?.followed ?? false) ? "已关注" : "回关",
radius:20, radius: 20,
icons: Icon( icons: Icon(
(message?.followed ?? false) (message?.followed ?? false)
? Icons.check ? Icons.check
: Icons.add, : Icons.add,
color: (message?.followed?? false) color: (message?.followed ?? false)
? Color(0xFF808080) ? Color(0xFF808080)
: Colors.white, : Colors.white,
size: 12, size: 12,
@ -1009,9 +1045,11 @@ class _SystemDetails extends State<SystemDetails> {
), ),
], ],
), ),
SizedBox(height:8.h,), SizedBox(
height: 8.h,
),
Container( Container(
margin: EdgeInsets.only(top: 16.h,bottom:16.h), margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h, height: 1.h,
width: double.infinity, width: double.infinity,
color: Color(0xFFF7F7F7), color: Color(0xFFF7F7F7),
@ -1061,11 +1099,11 @@ class _SystemDetails extends State<SystemDetails> {
child: TextField( child: TextField(
maxLines: 8, maxLines: 8,
minLines: 1, minLines: 1,
focusNode:commentFocus, focusNode: commentFocus,
controller:commentTextController, controller: commentTextController,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
hintText:hintText, hintText: hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF868686), color: Color(0xFF868686),

1
lib/message/system_message.dart

@ -176,6 +176,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
padding: EdgeInsets.only(bottom: 30.h),
child: Column( child: Column(
children: [ children: [
Container( Container(

300
pubspec.lock

File diff suppressed because it is too large Load Diff

4
pubspec.yaml

@ -3,7 +3,7 @@ description: 一心回乡.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 3.2.0+41 version: 3.2.3+44
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -103,6 +103,8 @@ dependencies:
emoji_picker_flutter: ^1.4.1 emoji_picker_flutter: ^1.4.1
mqtt_client: ^9.6.8
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save