diff --git a/lib/app/routes/routes.dart b/lib/app/routes/routes.dart index d3e60d82..9d6fd592 100644 --- a/lib/app/routes/routes.dart +++ b/lib/app/routes/routes.dart @@ -8,6 +8,7 @@ import 'package:dairy_app/features/notes/presentation/pages/note_create_page.dar import 'package:dairy_app/features/notes/presentation/pages/note_read_only_page.dart'; import 'package:dairy_app/generated/l10n.dart'; import 'package:flutter/material.dart'; +import 'package:dairy_app/core/pages/welcome_page.dart'; class RouteGenerator { static Route generateRoute(RouteSettings settings) { @@ -15,8 +16,9 @@ class RouteGenerator { final log = printer("Router"); log.i("routing to ${settings.name} with args $args"); - - if (settings.name == HomePage.route) { + if (settings.name == WelcomePage.route) { + return MaterialPageRoute(builder: (_) => const WelcomePage()); + } else if (settings.name == HomePage.route) { return MaterialPageRoute(builder: (_) => const HomePage()); } else if (settings.name == AuthPage.route) { return MaterialPageRoute(builder: (_) => AuthPage()); diff --git a/lib/app/view/app.dart b/lib/app/view/app.dart index 5cbb93dc..4cc18247 100644 --- a/lib/app/view/app.dart +++ b/lib/app/view/app.dart @@ -8,6 +8,7 @@ import 'package:dairy_app/app/themes/plain_dark.dart'; import 'package:dairy_app/core/dependency_injection/injection_container.dart'; import 'package:dairy_app/core/logger/logger.dart'; import 'package:dairy_app/core/pages/home_page.dart'; +import 'package:dairy_app/core/pages/welcome_page.dart'; import 'package:dairy_app/features/auth/data/repositories/pin_auth_repository.dart'; import 'package:dairy_app/features/auth/presentation/bloc/auth_form/auth_form_bloc.dart'; import 'package:dairy_app/features/auth/presentation/bloc/auth_session/auth_session_bloc.dart'; @@ -15,7 +16,6 @@ import 'package:dairy_app/features/auth/presentation/bloc/font/font_cubit.dart'; import 'package:dairy_app/features/auth/presentation/bloc/locale/locale_cubit.dart'; import 'package:dairy_app/features/auth/presentation/bloc/theme/theme_cubit.dart'; import 'package:dairy_app/features/auth/presentation/bloc/user_config/user_config_cubit.dart'; -import 'package:dairy_app/features/auth/presentation/pages/auth_page.dart'; import 'package:dairy_app/features/auth/presentation/pages/pin_auth_page.dart'; import 'package:dairy_app/features/notes/presentation/bloc/notes/notes_bloc.dart'; import 'package:dairy_app/features/notes/presentation/bloc/notes_fetch/notes_fetch_cubit.dart'; @@ -157,7 +157,7 @@ class _AppViewState extends State { (route) => false); } else { _navigator.pushAndRemoveUntil( - MaterialPageRoute(builder: (_) => AuthPage()), + MaterialPageRoute(builder: (_) => const WelcomePage()), (route) => false); } } else if (state is Authenticated) { diff --git a/lib/core/data/quotes.dart b/lib/core/data/quotes.dart new file mode 100644 index 00000000..72ce588b --- /dev/null +++ b/lib/core/data/quotes.dart @@ -0,0 +1,66 @@ +class Quotes { + static const List quotes = [ + // Writing and Journaling Specific Quotes + "Every page is a new beginning, waiting to be written.", + "Your story matters. Write it with courage and honesty.", + "In the quiet moments of reflection, truth emerges.", + "This journal is a map of your journey, with blank spaces yet to be explored.", + "Memories fade, but words preserve the essence of who we are.", + "Writing is how we listen to ourselves.", + "Today's thoughts become tomorrow's memories.", + "Your experiences are the ink, and this journal is your canvas.", + "Breathe life into your thoughts, one page at a time.", + "Vulnerability is strength when written in truth.", + "Every entry is a conversation with your future self.", + "Words are the bridges between your present and your potential.", + "Your journal is a sanctuary of unfiltered truth.", + "Write without fear, edit without mercy.", + "Each page is a step towards understanding yourself.", + + // Motivational and Inspirational Quotes + "Believe you can and you're halfway there.", + "The only way to do great work is to love what you do.", + "Your life is your story. Write well. Edit often.", + "Every day is a chance to begin again.", + "You are capable of amazing things.", + "The future belongs to those who believe in the beauty of their dreams.", + "Start where you are. Use what you have. Do what you can.", + "Your potential is limited only by your imagination.", + "Small steps every day lead to big changes.", + "You are stronger than you think.", + "Growth happens outside of your comfort zone.", + "Your journey is unique and beautiful.", + "Embrace the glorious mess that you are.", + "Progress, not perfection.", + "You are the author of your own life.", + + // Self-Reflection and Personal Growth Quotes + "Know yourself. Love yourself. Be yourself.", + "Reflection is the lamp of the heart.", + "Understanding yourself is the beginning of wisdom.", + "Your thoughts are the architects of your destiny.", + "Honesty with yourself is the foundation of all growth.", + "Healing begins with a single honest word.", + "Every challenge is an opportunity to grow.", + "Listen to your inner voice.", + "Self-discovery is the greatest adventure.", + "Your emotions are valid. Your experiences matter.", + "Kindness begins with being kind to yourself.", + "Transform your narrative, transform your life.", + "In silence, you'll find your truest self.", + "Vulnerability is not weakness, it's courage.", + "You are constantly becoming.", + + // Additional Motivational Quotes + "Dream big. Start small. Begin now.", + "Your attitude determines your direction.", + "Every day is a gift, that's why it's called the present.", + "Courage doesn't always roar. Sometimes it's the quiet voice saying 'I'll try again tomorrow'.", + "You are enough, just as you are.", + "Create the things you wish existed.", + "Life is 10% what happens to you and 90% how you react to it.", + "The best time to plant a tree was 20 years ago. The second best time is now.", + "Your limitations are only in your mind.", + "Keep going. Every step counts." + ]; +} diff --git a/lib/core/pages/welcome_page.dart b/lib/core/pages/welcome_page.dart new file mode 100644 index 00000000..5217dfad --- /dev/null +++ b/lib/core/pages/welcome_page.dart @@ -0,0 +1,86 @@ +import 'dart:math'; + +import 'package:dairy_app/core/data/quotes.dart'; +import 'package:dairy_app/features/auth/presentation/pages/auth_page.dart'; +import 'package:flutter/material.dart'; + +class WelcomePage extends StatefulWidget { + static String get route => '/'; + + const WelcomePage({Key? key}) : super(key: key); + + @override + _WelcomePageState createState() => _WelcomePageState(); +} + +class _WelcomePageState extends State { + late String quote; + + @override + void initState() { + super.initState(); + // Initialize the quote + quote = getQuote(); + + // Add a delay to navigate after displaying the quote + Future.delayed(const Duration(seconds: 2), () { + Navigator.of(context).pushNamed(AuthPage.route); + }); + } + + String getQuote() { + const quotes = Quotes.quotes; + final random = Random(); + return quotes[random.nextInt(quotes.length)]; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: const Color(0xFF9E8BD9), // Set background color + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Application logo + SizedBox( + width: 150, + height: 150, + child: ClipOval( + // Crop image in oval shape to match homepage logo + child: Transform.scale( + scale: 1.5, // Increase the scale to crop more from the image + child: Image.asset( + 'assets/images/splash_icon_4.webp', + errorBuilder: (context, error, stackTrace) { + return const Text( + 'Error loading image', + style: TextStyle(color: Colors.red), + ); + }, + fit: BoxFit + .cover, // Ensures the image fills the circular frame + ), + ), + ), + ), + const SizedBox(height: 20), + // Display the random quote + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Text( + quote, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 18, + color: Colors.white, + fontStyle: FontStyle.italic, + ), + ), + ), + ], + ), + ), + ); + } +}