提交 9de18cc3 authored 作者: yueweilu's avatar yueweilu

消息界面

上级 a2543a67
......@@ -106,7 +106,9 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
Expanded(
child: GestureDetector(
onTap: (){
context.pushNamed(Routes.creditPoints);
context.pushNamed(Routes.creditPoints).then((value){
print('---------------------$value');
});
},
child: Container(
decoration: BoxDecoration(
......
......@@ -32,7 +32,11 @@ class _CoursePageState extends State<CoursePage> {
icon: const Icon(Ionicons.timer),
onPressed: () => context.pushNamed(Routes.msgs),
),
badges.Badge(
GestureDetector(
onTap: (){
context.pushNamed(Routes.msgs);
},
child: badges.Badge(
position: badges.BadgePosition.topEnd(top: -5, end: 0),
badgeContent: const Text('10',style: TextStyle(fontSize: 7,color: Colors.white),),
badgeStyle: const badges.BadgeStyle(
......@@ -45,6 +49,7 @@ class _CoursePageState extends State<CoursePage> {
icon: const Icon(Ionicons.notifications),
onPressed: () => context.pushNamed(Routes.msgs),
),
),
)
// CustomButton.icon(
// padding: EdgeInsets.zero,
......
......@@ -5,5 +5,6 @@ library credit_points;
import 'package:flutter/material.dart';
import 'package:flutter_book/theme.dart';
import 'package:flutter_book/utils/index.dart';
import 'package:go_router/go_router.dart';
part 'view.dart';
\ No newline at end of file
......@@ -5,7 +5,12 @@ class CreditPointsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
return WillPopScope(
onWillPop: () async {
context.pop('111111');
return false;
},
child: Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text('积分'),
......@@ -15,7 +20,7 @@ class CreditPointsPage extends StatelessWidget {
// 积分卡片
Container(
color: AppTheme.primary.withOpacity(0.02),
padding: EdgeInsets.all(10),
padding: const EdgeInsets.all(10),
child: Container(
padding: const EdgeInsets.only(left: 17,top: 18,bottom: 24,right: 17),
decoration: BoxDecoration(
......@@ -85,7 +90,7 @@ class CreditPointsPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('可用积分',style: TextStyle(fontSize: 16,height: 1.4,fontWeight: Fonts.medium,color: Colours.c3),),
const Text('可用积分',style: TextStyle(fontSize: 16,height: 1.4,fontWeight: Fonts.medium,color: Colours.c3),),
Gaps.vGaps10,
Container(
height: 0.5,
......@@ -94,14 +99,22 @@ class CreditPointsPage extends StatelessWidget {
),
Gaps.vGaps15,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(text: TextSpan(
RichText(text: const TextSpan(
children: [
TextSpan(text: '抵扣',style: TextStyle(color: Colours.c9,fontSize: 13,height: 1.4)),
TextSpan(text: '¥9.90',style: TextStyle(color: AppTheme.primary,fontSize: 13,height: 1.4,fontWeight: Fonts.medium)),
TextSpan(text: '使用9900积分',style: TextStyle(color: Colours.c9,fontSize: 13,height: 1.4)),
]
))
)),
SizedBox(
width: 15,
height: 15,
child: Image.asset(
'assets/images/uncheck.png',
),
)
],
)
],
......@@ -109,6 +122,7 @@ class CreditPointsPage extends StatelessWidget {
)
],
),
),
);
}
}
......@@ -2,4 +2,9 @@ library user_msg;
import 'package:flutter/material.dart';
import '../../theme.dart';
import '../../utils/index.dart';
import 'package:badges/badges.dart' as badges;
part 'view.dart';
part 'widgets/item.dart';
\ No newline at end of file
......@@ -10,6 +10,15 @@ class MsgPage extends StatelessWidget {
title: const Text('消息中心'),
centerTitle: true,
),
body: Container(
color: Colours.cF9,
child: ListView.builder(
itemBuilder: (BuildContext context, int index){
return BuildItem();
},
itemCount: 5,
),
),
);
}
}
part of user_msg;
class BuildItem extends StatelessWidget {
const BuildItem({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.only(left: 10,right: 10,top:10),
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
height: 75,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
badges.Badge(
position: badges.BadgePosition.topEnd(top: 0, end: 0),
badgeStyle: const badges.BadgeStyle(
badgeColor: AppTheme.primary,
shape: badges.BadgeShape.circle
),
child: Container(
width: 30,
height: 30,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: AppTheme.primary.withOpacity(0.1)
),
child: Image.asset(
'assets/images/msg.png',
),
),
),
Gaps.hGaps10,
Expanded(
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('积分过期提醒',style: TextStyle(fontSize: 15,height: 1.4,fontWeight: Fonts.medium,color: Colours.c3),),
Text('2023-12-12',style: TextStyle(fontSize:11,height: 1.4,color: Colours.c9))
],
),
Gaps.vGaps5,
Text('您有2000积分即将过期。',style: TextStyle(fontSize: 13,height: 1.4,color: Colours.c6),)
],
),
)
],
),
);
}
}
......@@ -25,6 +25,7 @@ class Colours {
static const cBlue = Color(0xFF2A82D9);
static const cE2 = Color(0xFFE2E2E2);
static const cF2 = Color(0xFFF2F2F2);
static const cF9 = Color(0xFFF9F9F9);
static const cC7 = Color(0xFFC7C7C7);
static const cE0 = Color(0xFFE0E0E0);
static const cE7 = Color(0xFFE7E7E7);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论