BioFlux/lib/screens/message_screen.dart
2026-01-22 16:33:07 +08:00

108 lines
3.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../widgets/glass_card.dart';
class MessageScreen extends StatelessWidget {
const MessageScreen({super.key});
@override
Widget build(BuildContext context) {
final List<Map<String, dynamic>> messages = [
{
"title": "Hydration Alert",
"body": "You haven't logged any water for 2 hours. Your metabolic sphere is starting to wither.",
"time": "10:30 AM",
"icon": Icons.warning_amber_rounded,
"color": Colors.orangeAccent,
},
{
"title": "Daily Goal Achieved!",
"body": "Congratulations! You hit your 2500ml target yesterday. Keep the streak alive!",
"time": "09:00 AM",
"icon": Icons.emoji_events_rounded,
"color": Colors.amber,
},
{
"title": "Morning Insight",
"body": "Drinking water immediately after waking up activates your internal organs.",
"time": "07:15 AM",
"icon": Icons.lightbulb_outline_rounded,
"color": Colors.blueAccent,
},
{
"title": "System Update",
"body": "Smart Metabolism Tracking is now active. We'll adjust your goals based on your workout data.",
"time": "Yesterday",
"icon": Icons.system_update_rounded,
"color": Colors.purpleAccent,
},
];
return Scaffold(
body: SafeArea(
child: ListView(
padding: const EdgeInsets.all(24),
children: [
Text(
"Notifications",
style: GoogleFonts.montserrat(fontSize: 28, fontWeight: FontWeight.bold)
),
const SizedBox(height: 20),
...messages.map((msg) => Padding(
padding: const EdgeInsets.only(bottom: 16.0),
child: _buildMessageCard(msg),
)),
],
),
),
);
}
Widget _buildMessageCard(Map<String, dynamic> msg) {
return GlassCard(
padding: const EdgeInsets.all(16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: (msg['color'] as Color).withOpacity(0.1),
shape: BoxShape.circle,
),
child: Icon(msg['icon'] as IconData, color: msg['color'] as Color, size: 24),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
msg['title'] as String,
style: GoogleFonts.montserrat(fontWeight: FontWeight.bold, fontSize: 14),
),
Text(
msg['time'] as String,
style: GoogleFonts.lato(fontSize: 10, color: Colors.grey),
),
],
),
const SizedBox(height: 6),
Text(
msg['body'] as String,
style: GoogleFonts.lato(fontSize: 13, color: Colors.grey.shade700, height: 1.4),
),
],
),
),
],
),
);
}
}