|
|
@ -1,7 +1,12 @@
|
|
|
|
import 'package:aku_community_manager/style/app_style.dart';
|
|
|
|
import 'package:aku_community_manager/style/app_style.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_community_manager/ui/widgets/common/aku_scaffold.dart';
|
|
|
|
|
|
|
|
import 'package:aku_ui/aku_ui.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:get/instance_manager.dart';
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class Message extends StatefulWidget {
|
|
|
|
class Message extends StatefulWidget {
|
|
|
|
Message({Key key}) : super(key: key);
|
|
|
|
Message({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
@ -11,58 +16,106 @@ class Message extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _MessageState extends State<Message> {
|
|
|
|
class _MessageState extends State<Message> {
|
|
|
|
|
|
|
|
|
|
|
|
Widget _messageType(String type){
|
|
|
|
Widget _messageTypeImage(String type){
|
|
|
|
|
|
|
|
Icon path;
|
|
|
|
|
|
|
|
Color ca;
|
|
|
|
|
|
|
|
Color cb;
|
|
|
|
switch (type) {
|
|
|
|
switch (type) {
|
|
|
|
case'系统消息' :
|
|
|
|
case'系统消息' :
|
|
|
|
return Container(
|
|
|
|
path=Icon(Icons.system_update,size: 66.w,) ;
|
|
|
|
width: 88.w,height: 88.w,
|
|
|
|
ca=Color(0xFFFFDE9A);
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
cb=Color(0xFFFFB00A);
|
|
|
|
borderRadius: BorderRadius.circular(44.w),
|
|
|
|
|
|
|
|
gradient: LinearGradient(begin: Alignment.topCenter,end: Alignment.bottomCenter,colors: [
|
|
|
|
|
|
|
|
Color(0xFFFFDE9A),
|
|
|
|
|
|
|
|
Color(0xFFFFB00A),
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Icon(Icons.message,size:66.w),);
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case '评论消息':
|
|
|
|
case '评论消息':
|
|
|
|
|
|
|
|
path=Icon(Icons.message,size: 66.w,) ;
|
|
|
|
|
|
|
|
ca=Color(0xFF81D1FF);
|
|
|
|
|
|
|
|
cb=Color(0xFF1792FF);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
}
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: 88.w,height: 88.w,
|
|
|
|
width: 88.w,
|
|
|
|
|
|
|
|
height: 88.w,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(44.w),
|
|
|
|
borderRadius: BorderRadius.circular(44.w),
|
|
|
|
gradient: LinearGradient(begin: Alignment.topCenter,end: Alignment.bottomCenter,colors: [
|
|
|
|
gradient: LinearGradient(
|
|
|
|
Color(0xFF81D1FF),
|
|
|
|
begin: Alignment.topCenter,
|
|
|
|
Color(0xFF1792FF),
|
|
|
|
end: Alignment.bottomCenter,
|
|
|
|
|
|
|
|
colors: [
|
|
|
|
|
|
|
|
ca,
|
|
|
|
|
|
|
|
cb,
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Icon(Icons.message_sharp,size:66.w),);
|
|
|
|
child: path,
|
|
|
|
default:
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _messageListTile(String date, Widget messageImage, String title,String text,int number,Widget page) {
|
|
|
|
Widget _messageList(String date,String type){
|
|
|
|
return AkuButton(
|
|
|
|
return Container(
|
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
|
padding: EdgeInsets.only(top:24.w,left:32.w,),
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Get.to(page);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 136.w,
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 24.w,
|
|
|
|
|
|
|
|
left: 32.w,
|
|
|
|
|
|
|
|
bottom: 24.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
|
|
|
|
messageImage,
|
|
|
|
SizedBox(width: 24.w,),
|
|
|
|
SizedBox(
|
|
|
|
Column(
|
|
|
|
width: 24.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text('系统通知',style: AppStyle().primaryStyle,),
|
|
|
|
Text(
|
|
|
|
|
|
|
|
title,
|
|
|
|
|
|
|
|
style: AppStyle().primaryStyle,
|
|
|
|
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Text(date, style: AppStyle().minorStyle),
|
|
|
|
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
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return AkuScaffold(
|
|
|
|
return AkuScaffold(
|
|
|
@ -71,8 +124,13 @@ class _MessageState extends State<Message> {
|
|
|
|
body: ListView(
|
|
|
|
body: ListView(
|
|
|
|
padding: EdgeInsets.only(top: 16.w),
|
|
|
|
padding: EdgeInsets.only(top: 16.w),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
|
|
|
|
_messageListTile('2020-10-23 9:00',_messageTypeImage('系统消息'), '系统消息','你有一条新的报事报修待处理' ,5,SystemMessage()),
|
|
|
|
],),
|
|
|
|
Divider(
|
|
|
|
|
|
|
|
height: 1.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_messageListTile('2020-10-23 10:00', _messageTypeImage('评论消息'),'评论消息', '你有一条新的评论回复',7,SystemMessage()),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|