36 lines
1.7 KiB
Dart
36 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class MessagesScreen extends StatelessWidget {
|
|
const MessagesScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(title: const Text('消息')),
|
|
body: ListView(
|
|
padding: const EdgeInsets.all(16),
|
|
children: [
|
|
_notificationTile(Icons.event, '活动提醒', '您报名的「太极晨练」明天7:00开始', '10分钟前', const Color(0xFF1976D2)),
|
|
_notificationTile(Icons.check_circle, '报名成功', '您已成功报名「周末茶话会」', '1小时前', const Color(0xFF4CAF50)),
|
|
_notificationTile(Icons.payment, '支付通知', '挂号费¥50已支付成功', '昨天', const Color(0xFFFF9800)),
|
|
_notificationTile(Icons.chat, '问诊回复', '王医生已回复您的问诊', '昨天', const Color(0xFF9C27B0)),
|
|
_notificationTile(Icons.campaign, '系统通知', '欢迎使用伴享!完善资料赢取积分', '2天前', const Color(0xFF607D8B)),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _notificationTile(IconData icon, String title, String content, String time, Color color) {
|
|
return Card(
|
|
margin: const EdgeInsets.only(bottom: 8),
|
|
child: ListTile(
|
|
leading: CircleAvatar(backgroundColor: color.withOpacity(0.1), child: Icon(icon, color: color)),
|
|
title: Text(title, style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
|
|
subtitle: Text(content, style: const TextStyle(fontSize: 14, color: Color(0xFF666666))),
|
|
trailing: Text(time, style: const TextStyle(fontSize: 12, color: Color(0xFF999999))),
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
),
|
|
);
|
|
}
|
|
}
|