消息页,系统消息页完成

hmxc
张萌 4 years ago
parent 6f02b7d4fe
commit a33179c2de

@ -2,6 +2,7 @@ import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/home/messages/message.dart';
import 'package:aku_community_manager/ui/home/personal_draw.dart'; import 'package:aku_community_manager/ui/home/personal_draw.dart';
import 'package:aku_community_manager/ui/tool_pages/scan_page.dart'; import 'package:aku_community_manager/ui/tool_pages/scan_page.dart';
import 'package:aku_ui/aku_ui.dart'; import 'package:aku_ui/aku_ui.dart';
@ -201,7 +202,9 @@ class _HomePageState extends State<HomePage> {
minWidth: 78.w, minWidth: 78.w,
// //
height: double.infinity, height: double.infinity,
onPressed: () {}, onPressed: () {
Get.to(Message());
},
child: Column(children: [ child: Column(children: [
Icon( Icon(
Icons.access_time, Icons.access_time,

@ -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,68 +16,121 @@ 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(
children:[ mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 24.w,), messageImage,
Column( SizedBox(
width: 24.w,
),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [ children: [
Text(
title,
style: AppStyle().primaryStyle,
),
Spacer(),
Text(date, style: AppStyle().minorStyle),
],
),
Spacer(),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text('系统通知',style: AppStyle().primaryStyle,), Text(text, style: AppStyle().minorStyle),
Spacer(), Spacer(),
Text(date,style:AppStyle().minorStyle), 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(
title: '消息', title: '消息',
titleStyle: AppStyle().barTitleStyle, titleStyle: AppStyle().barTitleStyle,
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()),
],
),
); );
} }
} }

@ -1,4 +1,5 @@
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/aku_ui.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';
@ -19,19 +20,21 @@ class _SystemMessageState extends State<SystemMessage> {
width: double.infinity, width: double.infinity,
height: 48.w + 33.w, height: 48.w + 33.w,
child: Text( child: Text(
'date', date,
style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp), style: TextStyle(color: AppStyle.minorTextColor, fontSize: 24.sp),
), ),
), ),
Container( Container(
padding: EdgeInsets.all(24.w), padding: EdgeInsets.only(top:24.w,left:24.w,right:24.w),
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row(children: [ Row(children: [
Icon( Container(
Icons.point_of_sale, width: 16.w,
size: 16.w, height: 16.w,
decoration: BoxDecoration(borderRadius:BorderRadius.circular(8.w),color:Color(0xFFFF4501)),
), ),
SizedBox( SizedBox(
width: 16.w, width: 16.w,
@ -43,7 +46,7 @@ class _SystemMessageState extends State<SystemMessage> {
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
), ),
Spacer(), SizedBox(height:8.w),
]), ]),
Text( Text(
'你有一条新的报事报修,请立即处理', '你有一条新的报事报修,请立即处理',
@ -52,6 +55,7 @@ class _SystemMessageState extends State<SystemMessage> {
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
SizedBox(height:24.w),
Row( Row(
children: [ children: [
Icon(Icons.contact_page, size: 40.w), Icon(Icons.contact_page, size: 40.w),
@ -71,6 +75,7 @@ class _SystemMessageState extends State<SystemMessage> {
), ),
], ],
), ),
SizedBox(height:16.w),
Row( Row(
children: [ children: [
Icon( Icon(
@ -89,6 +94,7 @@ class _SystemMessageState extends State<SystemMessage> {
color: AppStyle.primaryTextColor, fontSize: 28.sp)), color: AppStyle.primaryTextColor, fontSize: 28.sp)),
], ],
), ),
SizedBox(height:16.w),
Row( Row(
children: [ children: [
Icon( Icon(
@ -107,9 +113,14 @@ class _SystemMessageState extends State<SystemMessage> {
color: AppStyle.primaryTextColor, fontSize: 28.sp)), color: AppStyle.primaryTextColor, fontSize: 28.sp)),
], ],
), ),
Divider(), SizedBox(height:16.w),
Divider(height: 1.w,),
AkuButton( AkuButton(
onPressed: () {
},
child: Container( child: Container(
height: 88.w,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.only(left: 24.w), padding: EdgeInsets.only(left: 24.w),
child: Row( child: Row(
@ -134,10 +145,8 @@ class _SystemMessageState extends State<SystemMessage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AkuScaffold(
appBar: AppBar( title: '系统消息',
title: Text('消息', style: AppStyle().barTitleStyle),
),
body: ListView( body: ListView(
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),
children: [ children: [

Loading…
Cancel
Save