Browse Source

消息更改

dart3_last
wurong 2 years ago
parent
commit
ba718c6ecd
  1. 2
      android/app/build.gradle
  2. 208
      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 "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 'androidx.legacy:legacy-support-v4:1.0.0'

208
lib/message/system_details.dart

@ -23,6 +23,7 @@ class SystemDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
SystemDetails({this.arguments});
@override
State<StatefulWidget> createState() {
return _SystemDetails();
@ -34,6 +35,7 @@ class _SystemDetails extends State<SystemDetails> {
int pageNum = 1;
List<Message> messages = [];
int msgType = 0;
// String parenId = "0";
var commentFocus = FocusNode();
String hintText = S.current.liuxianinjingcaidepinglunba;
@ -43,7 +45,6 @@ class _SystemDetails extends State<SystemDetails> {
final TextEditingController commentTextController = TextEditingController();
int indexMsg = 0;
@override
void initState() {
super.initState();
@ -56,7 +57,6 @@ class _SystemDetails extends State<SystemDetails> {
});
}
_refresh() {
pageNum = 1;
queryMessage();
@ -98,7 +98,8 @@ class _SystemDetails extends State<SystemDetails> {
if (baseData != null && baseData.isSuccess) {
// widget.refresh();
queryMessage();
SmartDialog.showToast(isFollow?"取关成功":"关注成功", alignment: Alignment.center);
SmartDialog.showToast(isFollow ? "取关成功" : "关注成功",
alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
@ -125,8 +126,7 @@ class _SystemDetails extends State<SystemDetails> {
FocusScope.of(context).unfocus();
Navigator.of(context).pop();
SmartDialog.showToast("发布成功", alignment: Alignment.center);
}
else{
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@ -139,7 +139,15 @@ class _SystemDetails extends State<SystemDetails> {
appBar: MyAppBar(
background: Colors.white,
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,
titleColor: Colors.black,
),
@ -159,24 +167,17 @@ class _SystemDetails extends State<SystemDetails> {
onLoading: () {
queryMessage();
},
child:
Container(
child: Container(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child:
Container(
child: Container(
child: Column(
children: [
if(msgType == 2)
orderMessage(),
if(msgType == 3)
rechargeMessage(),
if(msgType == 5)
fabulousMessage(),
if(msgType == 6)
commentMessage(),
if(msgType == 4)
followMessage(),
if (msgType == 2) orderMessage(),
if (msgType == 3) rechargeMessage(),
if (msgType == 5) fabulousMessage(),
if (msgType == 6) commentMessage(),
if (msgType == 4) followMessage(),
],
),
),
@ -191,7 +192,8 @@ class _SystemDetails extends State<SystemDetails> {
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w),
padding:
EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
@ -221,14 +223,13 @@ class _SystemDetails extends State<SystemDetails> {
);
}),
],
)
);
));
}
Widget orderMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child:
Column(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -282,7 +283,8 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: Text(
Expanded(
child: Text(
message.content,
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -290,7 +292,8 @@ class _SystemDetails extends State<SystemDetails> {
fontSize: 12.sp,
color: Color(0xFF353535),
),
),),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
@ -316,7 +319,8 @@ class _SystemDetails extends State<SystemDetails> {
return Container(
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.only(top:10.h,bottom:20.h,left: 20.w,right: 20.w),
padding:
EdgeInsets.only(top: 10.h, bottom: 20.h, left: 20.w, right: 20.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
@ -346,14 +350,13 @@ class _SystemDetails extends State<SystemDetails> {
);
}),
],
)
);
));
}
Widget rechargeMessageItem(Message message) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
child:
Column(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -413,12 +416,15 @@ class _SystemDetails extends State<SystemDetails> {
color: Color(0xFF353535),
),
),
SizedBox(height:8.h,),
SizedBox(
height: 8.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: Text(
Expanded(
child: Text(
message.content,
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -426,7 +432,8 @@ class _SystemDetails extends State<SystemDetails> {
fontSize: 12.sp,
color: Color(0xFF353535),
),
),),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
@ -476,7 +483,10 @@ class _SystemDetails extends State<SystemDetails> {
Navigator.of(context).pushNamed(
'/router/community_details',
arguments: {
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(),
"businessId":
jsonDecode(messages[position].relational)[
"businessId"]
.toString(),
"mid": messages[position].mid
},
);
@ -485,14 +495,13 @@ class _SystemDetails extends State<SystemDetails> {
);
}),
],
)
);
));
}
Widget fabulousMessageItem(Message message) {
var messageRelational = jsonDecode(message.relational);
return Container(
child:
Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -505,21 +514,24 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(width: 8,),
Expanded(child:Column(
SizedBox(
width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
messageRelational["nickname"] ?? "",
Text(messageRelational["nickname"] ?? "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF1A1A1A))
color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
),
SizedBox(width:8.w,),
Text(
"点赞了",
style: TextStyle(
@ -530,7 +542,9 @@ class _SystemDetails extends State<SystemDetails> {
),
],
),
SizedBox(height: 8,),
SizedBox(
height: 8,
),
Text(
message.updateTime,
style: TextStyle(
@ -538,7 +552,9 @@ class _SystemDetails extends State<SystemDetails> {
color: Color(0xFFA29E9E),
),
),
SizedBox(height:12.h,),
SizedBox(
height: 12.h,
),
Container(
width: double.infinity,
color: Color(0xFFF2F2F2),
@ -567,7 +583,8 @@ class _SystemDetails extends State<SystemDetails> {
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(width: 2.w),
Expanded(child:Text(
Expanded(
child: Text(
messageRelational["content"] ?? "",
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -577,7 +594,8 @@ class _SystemDetails extends State<SystemDetails> {
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),)
),
)
],
),
),
@ -623,7 +641,10 @@ class _SystemDetails extends State<SystemDetails> {
Navigator.of(context).pushNamed(
'/router/community_details',
arguments: {
"businessId":jsonDecode(messages[position].relational)["businessId"].toString(),
"businessId":
jsonDecode(messages[position].relational)[
"businessId"]
.toString(),
"mid": messages[position].mid
},
);
@ -632,14 +653,13 @@ class _SystemDetails extends State<SystemDetails> {
);
}),
],
)
);
));
}
Widget commentMessageItem(Message message, index) {
var messageRelational = jsonDecode(message.relational);
return Container(
child:
Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -652,8 +672,11 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(width: 8,),
Expanded(child:Column(
SizedBox(
width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -661,20 +684,21 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Column(
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
messageRelational["nickname"],
Text(messageRelational["nickname"],
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF1A1A1A))
color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
),
SizedBox(width:8.w,),
Text(
"评论了",
style: TextStyle(
@ -685,7 +709,9 @@ class _SystemDetails extends State<SystemDetails> {
),
],
),
SizedBox(height: 8,),
SizedBox(
height: 8,
),
Text(
message.updateTime,
style: TextStyle(
@ -694,7 +720,8 @@ class _SystemDetails extends State<SystemDetails> {
),
),
],
),),
),
),
GestureDetector(
onTap: () {
setState(() {
@ -728,7 +755,9 @@ class _SystemDetails extends State<SystemDetails> {
)
],
),
SizedBox(height:8.h,),
SizedBox(
height: 8.h,
),
// Text(
// messageRelational["content"],
// maxLines: 2,
@ -811,7 +840,8 @@ class _SystemDetails extends State<SystemDetails> {
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(width: 2.w),
Expanded(child:Text(
Expanded(
child: Text(
messageRelational["content"],
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -821,7 +851,8 @@ class _SystemDetails extends State<SystemDetails> {
fontWeight: MyFontWeight.regular,
color: Color(0xFF808080),
),
),)
),
)
],
),
),
@ -873,19 +904,17 @@ class _SystemDetails extends State<SystemDetails> {
);
}),
],
)
);
));
}
Widget followMessageItem(Message message) {
var messageRelational = jsonDecode(message.relational);
if (message.relational.startsWith("{"))
return Container(
child:
Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MImage(
messageRelational["avatar"],
width: 44,
@ -895,8 +924,11 @@ class _SystemDetails extends State<SystemDetails> {
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
SizedBox(width: 8,),
Expanded(child:Column(
SizedBox(
width: 8,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -904,20 +936,21 @@ class _SystemDetails extends State<SystemDetails> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: Column(
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
messageRelational["nickname"],
Text(messageRelational["nickname"],
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF1A1A1A))
color: Color(0xFF1A1A1A))),
SizedBox(
width: 8.w,
),
SizedBox(width:8.w,),
Text(
"关注了你",
style: TextStyle(
@ -928,7 +961,9 @@ class _SystemDetails extends State<SystemDetails> {
),
],
),
SizedBox(height: 8,),
SizedBox(
height: 8,
),
Text(
message.updateTime,
style: TextStyle(
@ -937,15 +972,16 @@ class _SystemDetails extends State<SystemDetails> {
),
),
],
),),
),
),
GestureDetector(
onTap: () {
setState(() {
_vipFollow(messageRelational["mid"].toString(),message?.followed ?? false);
_vipFollow(messageRelational["mid"].toString(),
message?.followed ?? false);
});
},
child:
RoundButton(
child: RoundButton(
height: 21.h,
width: 56.w,
padding: EdgeInsets.all(2),
@ -1009,7 +1045,9 @@ class _SystemDetails extends State<SystemDetails> {
),
],
),
SizedBox(height:8.h,),
SizedBox(
height: 8.h,
),
Container(
margin: EdgeInsets.only(top: 16.h, bottom: 16.h),
height: 1.h,

1
lib/message/system_message.dart

@ -176,6 +176,7 @@ class _SystemMessagePage extends State<SystemMessagePage> {
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
padding: EdgeInsets.only(bottom: 30.h),
child: Column(
children: [
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
version: 3.2.0+41
version: 3.2.3+44
environment:
sdk: ">=2.7.0 <3.0.0"
@ -103,6 +103,8 @@ dependencies:
emoji_picker_flutter: ^1.4.1
mqtt_client: ^9.6.8
dev_dependencies:
flutter_test:
sdk: flutter

Loading…
Cancel
Save