评论消息页完成

hmxc
张萌 4 years ago
parent 1a13864801
commit 2ba994f2f9

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@ -0,0 +1,146 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_common_widgets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:aku_community_manager/const/resource.dart';
class CommentMessage extends StatefulWidget {
CommentMessage({Key key}) : super(key: key);
@override
_CommentMessageState createState() => _CommentMessageState();
}
class _CommentMessageState extends State<CommentMessage> {
Widget _messageList(String date, String name, String comment,) {
return Column(
children: [
Container(
alignment: Alignment.center,
width: double.infinity,
height: 48.w + 33.w,
child: Text(
date,
style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp),
),
),
Container(
padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w),
color: Color(0xFFFFFFFF),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(children: [
Container(
width: 16.w,
height: 16.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFFF4501)),
),
SizedBox(
width: 16.w,
),
Text(
'系统通知',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.sp,
fontWeight: FontWeight.w600),
),
SizedBox(height: 8.w),
]),
Text(
'你有一条新的报事报修,请立即处理',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
SizedBox(height: 24.w),
Row(
children: [
Image.asset(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
width: 40.w,
height: 40.w,
),
SizedBox(
width: 4.w,
),
Text(
'评论人',
style: TextStyle(
color: AppStyle.minorTextColor, fontSize: 28.sp),
),
Spacer(),
Text(
name,
style: TextStyle(
color: AppStyle.primaryTextColor, fontSize: 28.sp),
),
],
),
SizedBox(height: 16.w),
Row(
children: [
Image.asset(
R.ASSETS_MESSAGE_IC_STAR_PNG,
width: 40.w,
height: 40.w,
),
SizedBox(
width: 4.w,
),
Text('综合评分',
style: TextStyle(
color: AppStyle.minorTextColor, fontSize: 28.sp)),
Spacer(),
Text(comment,
style: TextStyle(
color: AppStyle.primaryTextColor, fontSize: 28.sp)),
],
),
SizedBox(height: 16.w),
Divider(
height: 1.w,
),
AkuButton(
onPressed: () {},
child: Container(
height: 88.w,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 24.w),
child: Row(
children: [
Text(
'查看详情',
style: TextStyle(
color: AppStyle.primaryTextColor, fontSize: 28.sp),
),
Spacer(),
Icon(Icons.arrow_forward_ios, size: 22.w),
],
),
),
),
],
),
),
],
);
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '评论消息',
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
_messageList('2020-10-23 10:00', '杨建', '四星'),
_messageList('2020-10-24 11:00', '刘能', '四星'),
],
),
);
}
}

@ -1,5 +1,6 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/home/messages/comment_message.dart';
import 'package:aku_community_manager/ui/home/messages/system_message.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/aku_ui.dart';
@ -16,107 +17,110 @@ class Message extends StatefulWidget {
}
class _MessageState extends State<Message> {
Widget _messageTypeImage(String type){
Widget _messageTypeImage(String type) {
String path;
Color ca;
Color cb;
switch (type) {
case'系统消息' :
path=R.ASSETS_MESSAGE_IC_TONGZHI_PNG;
ca=Color(0xFFFFDE9A);
cb=Color(0xFFFFB00A);
switch (type) {
case '系统消息':
path = R.ASSETS_MESSAGE_IC_TONGZHI_PNG;
ca = Color(0xFFFFDE9A);
cb = Color(0xFFFFB00A);
break;
case '评论消息':
path = R.ASSETS_MESSAGE_IC_PINGLUN_PNG;
ca = Color(0xFF81D1FF);
cb = Color(0xFF1792FF);
break;
case '评论消息':
path=R.ASSETS_MESSAGE_IC_PINGLUN_PNG;
ca=Color(0xFF81D1FF);
cb=Color(0xFF1792FF);
break;
default:
}
return Container(
width: 88.w,
height: 88.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(44.w),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
ca,
cb,
]),
),
child: Image.asset(path,width: 70.w,height: 70.w,),
);
width: 88.w,
height: 88.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(44.w),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
ca,
cb,
]),
),
child: Image.asset(
path,
width: 70.w,
height: 70.w,
),
);
}
Widget _messageListTile(String date, Widget messageImage, String title,String text,int number,Widget page) {
Widget _messageListTile(
String date, Widget messageImage, String title, String text, int number,
{VoidCallback onpressed}) {
return AkuButton(
color: Color(0xFFFFFFFF),
onPressed: () {
Get.to(page);
},
child: Container(
height: 136.w,
padding: EdgeInsets.only(
top: 24.w,
left: 32.w,
bottom: 24.w,
right: 31.w,
color: Color(0xFFFFFFFF),
onPressed: onpressed,
child: Container(
height: 136.w,
padding: EdgeInsets.only(
top: 24.w,
left: 32.w,
bottom: 24.w,
right: 31.w,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
messageImage,
SizedBox(
width: 24.w,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
messageImage,
SizedBox(
width: 24.w,
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Row(
children: [
Text(
title,
style: AppStyle().primaryStyle,
),
Spacer(),
Text(date, style: AppStyle().minorStyle),
],
Text(
title,
style: AppStyle().primaryStyle,
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(text, style: AppStyle().minorStyle),
Spacer(),
Container(
alignment: Alignment.center,
width: 32.w,
height: 32.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
color: Color(0xFFFF4501)),
child: Text(
number.toString(),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 20.sp,
),
),
Text(date, style: AppStyle().minorStyle),
],
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(text, style: AppStyle().minorStyle),
Spacer(),
Container(
alignment: Alignment.center,
width: 32.w,
height: 32.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.w),
color: Color(0xFFFF4501)),
child: Text(
number.toString(),
style: TextStyle(
color: Color(0xFFFFFFFF),
fontSize: 20.sp,
),
],
),
),
],
),
),
],
],
),
),
),
);
}
],
),
),
);
}
@override
Widget build(BuildContext context) {
@ -126,13 +130,25 @@ class _MessageState extends State<Message> {
body: ListView(
padding: EdgeInsets.only(top: 16.w),
children: [
_messageListTile('2020-10-23 9:00',_messageTypeImage('系统消息'), '系统消息','你有一条新的报事报修待处理' ,5,SystemMessage()),
_messageListTile('2020-10-23 9:00', _messageTypeImage('系统消息'), '系统消息',
'你有一条新的报事报修待处理', 5, onpressed: () {
Get.to(SystemMessage());
}),
Divider(
height: 1.w,
),
_messageListTile('2020-10-23 10:00', _messageTypeImage('评论消息'),'评论消息', '你有一条新的评论回复',7,SystemMessage()),
_messageListTile(
'2020-10-23 10:00',
_messageTypeImage('评论消息'),
'评论消息',
'你有一条新的评论回复',
7,
onpressed: () {
Get.to(CommentMessage());
},
),
],
),
);
}
}
}

@ -26,7 +26,7 @@ class _SystemMessageState extends State<SystemMessage> {
),
),
Container(
padding: EdgeInsets.only(top:24.w,left:24.w,right:24.w),
padding: EdgeInsets.only(top: 24.w, left: 24.w, right: 24.w),
color: Color(0xFFFFFFFF),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -35,7 +35,9 @@ class _SystemMessageState extends State<SystemMessage> {
Container(
width: 16.w,
height: 16.w,
decoration: BoxDecoration(borderRadius:BorderRadius.circular(8.w),color:Color(0xFFFF4501)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFFF4501)),
),
SizedBox(
width: 16.w,
@ -47,7 +49,7 @@ class _SystemMessageState extends State<SystemMessage> {
fontSize: 32.sp,
fontWeight: FontWeight.w600),
),
SizedBox(height:8.w),
SizedBox(height: 8.w),
]),
Text(
'你有一条新的报事报修,请立即处理',
@ -56,10 +58,14 @@ class _SystemMessageState extends State<SystemMessage> {
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
SizedBox(height:24.w),
SizedBox(height: 24.w),
Row(
children: [
Image.asset(R.ASSETS_MESSAGE_IC_PEOPLE_PNG,width: 40.w,height: 40.w,),
Image.asset(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
width: 40.w,
height: 40.w,
),
SizedBox(
width: 4.w,
),
@ -76,10 +82,14 @@ class _SystemMessageState extends State<SystemMessage> {
),
],
),
SizedBox(height:16.w),
SizedBox(height: 16.w),
Row(
children: [
Image.asset(R.ASSETS_MESSAGE_IC_PHONE_PNG,width: 40.w,height: 40.w,),
Image.asset(
R.ASSETS_MESSAGE_IC_PHONE_PNG,
width: 40.w,
height: 40.w,
),
SizedBox(
width: 4.w,
),
@ -92,10 +102,14 @@ class _SystemMessageState extends State<SystemMessage> {
color: AppStyle.primaryTextColor, fontSize: 28.sp)),
],
),
SizedBox(height:16.w),
SizedBox(height: 16.w),
Row(
children: [
Image.asset(R.ASSETS_MESSAGE_IC_AREA_PNG,width: 40.w,height: 40.w,),
Image.asset(
R.ASSETS_MESSAGE_IC_AREA_PNG,
width: 40.w,
height: 40.w,
),
SizedBox(
width: 4.w,
),
@ -108,12 +122,12 @@ class _SystemMessageState extends State<SystemMessage> {
color: AppStyle.primaryTextColor, fontSize: 28.sp)),
],
),
SizedBox(height:16.w),
Divider(height: 1.w,),
SizedBox(height: 16.w),
Divider(
height: 1.w,
),
AkuButton(
onPressed: () {
},
onPressed: () {},
child: Container(
height: 88.w,
alignment: Alignment.center,

Loading…
Cancel
Save