TKK_E32230148/lib/pages/reminder_page.dart

132 lines
4.0 KiB
Dart

import 'package:flutter/material.dart';
import '../widgets/ui_helpers.dart';
class ReminderPage extends StatelessWidget {
final bool reminderEnabled;
final int reminderHour;
final int reminderMinute;
final VoidCallback onSetReminderTime;
final ValueChanged<bool> onToggleReminder;
const ReminderPage({
super.key,
required this.reminderEnabled,
required this.reminderHour,
required this.reminderMinute,
required this.onSetReminderTime,
required this.onToggleReminder,
});
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: ModernCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(
children: [
Icon(
Icons.notifications_active,
color: Colors.white,
),
SizedBox(width: 10),
Text(
'DOOR REMINDER',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24,
),
),
],
),
const SizedBox(height: 30),
Container(
width: double.infinity,
padding: const EdgeInsets.all(30),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Colors.black,
),
child: Column(
children: [
Text(
'$reminderHour:${reminderMinute.toString().padLeft(2, '0')}',
style: const TextStyle(
color: Colors.white,
fontSize: 52,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 10),
const Text(
'Reminder Schedule',
style: TextStyle(
color: Colors.white54,
),
),
],
),
),
const SizedBox(height: 30),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Enable Reminder',
style: TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 4),
Text(
'Notification active',
style: TextStyle(
color: Colors.white54,
),
),
],
),
Switch(
value: reminderEnabled,
activeColor: Colors.greenAccent,
onChanged: onToggleReminder,
),
],
),
const SizedBox(height: 30),
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueAccent,
padding: const EdgeInsets.symmetric(
vertical: 18,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18),
),
),
onPressed: onSetReminderTime,
icon: const Icon(Icons.schedule),
label: const Text(
'SET REMINDER TIME',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
);
}
}