import 'package:animated_text_kit/animated_text_kit.
dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(SwaasApp());
}
class SwaasApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'SWAAS',
theme: ThemeData(
primaryColor: Colors.teal[700],
textTheme: GoogleFonts.robotoTextTheme(),
scaffoldBackgroundColor: Colors.white,
),
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildHeader(),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildQuickAccessGrid(context),
SizedBox(height: 24),
_buildHealthTip(),
SizedBox(height: 24),
_buildNextReminder(),
],
),
),
),
),
],
),
),
bottomNavigationBar: _buildBottomNavigationBar(),
);
}
Widget _buildHeader() {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.teal[700],
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Good Morning,',
style: GoogleFonts.roboto(
color: Colors.white,
fontSize: 18,
),
),
Text(
'Dhiraj!',
style: GoogleFonts.roboto(
color: Colors.white,
fontSize: 32,
fontWeight: FontWeight.bold,
),
),
],
),
);
}
Widget _buildQuickAccessGrid(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Quick Access',
style: GoogleFonts.roboto(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.teal[700],
),
),
SizedBox(height: 16),
GridView.count(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisCount: 2,
crossAxisSpacing: 16,
mainAxisSpacing: 16,
children: [
_buildQuickAccessButton(
context,
icon: Icons.alarm,
label: 'Set Reminder',
onTap: () {
// Navigate to set reminder page
},
),
_buildQuickAccessButton(
context,
icon: Icons.air,
label: 'Breathing Guide',
onTap: () {
// Navigate to breathing guide page
},
),
_buildQuickAccessButton(
context,
icon: Icons.question_answer,
label: 'Parameter Questionnaire',
onTap: () {
// Navigate to parameter questionnaire page
},
),
_buildQuickAccessButton(
context,
icon: Icons.person,
label: 'My Account',
onTap: () {
// Navigate to account settings page
},
),
],
),
],
);
}
Widget _buildQuickAccessButton(BuildContext context,
{required IconData icon, required String label, required Function() onTap}) {
return GestureDetector(
onTap: onTap,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 2,
blurRadius: 5,
offset: Offset(0, 3),
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
icon,
size: 40,
color: Colors.teal[700],
),
SizedBox(height: 8),
Text(
label,
textAlign: TextAlign.center,
style: GoogleFonts.roboto(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.teal[700],
),
),
],
),
),
);
}
Widget _buildHealthTip() {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.teal[50],
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Health Tip',
style: GoogleFonts.roboto(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.teal[700],
),
),
SizedBox(height: 8),
AnimatedTextKit(
animatedTexts: [
FadeAnimatedText(
'"Breathe. Let go. And remind yourself that this very moment is the
only one you know you have for sure."',
textStyle: GoogleFonts.roboto(
fontSize: 16,
color: Colors.teal[700],
fontStyle: FontStyle.italic,
),
duration: Duration(seconds: 5),
),
FadeAnimatedText(
'"Calmness is the cradle of power."',
textStyle: GoogleFonts.roboto(
fontSize: 16,
color: Colors.teal[700],
fontStyle: FontStyle.italic,
),
duration: Duration(seconds: 5),
),
],
repeatForever: true,
),
],
),
);
}
Widget _buildNextReminder() {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.orange[50],
borderRadius: BorderRadius.circular(12),
),
child: Row(
children: [
Icon(Icons.alarm, color: Colors.orange[700]),
SizedBox(width: 16),
Text(
'Next reminder at 10:15 AM',
style: GoogleFonts.roboto(
color: Colors.orange[700],
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
],
),
);
}
Widget _buildBottomNavigationBar() {
return BottomNavigationBar(
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.teal[700],
unselectedItemColor: Colors.grey,
currentIndex: 0, // Highlight Home
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.alarm),
label: 'Reminders',
),
BottomNavigationBarItem(
icon: Icon(Icons.notifications),
label: 'Notifications',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Settings',
),
],
);
}
}