diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 09da76b..2ce3fec 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -22,6 +22,7 @@ class _LandingPageState extends State { padding: const EdgeInsets.all(20), child: Column( children: [ + Center( child: Container( width: width, @@ -38,12 +39,14 @@ class _LandingPageState extends State { child: SizedBox( child: DefaultTextStyle( style: TextStyle( + fontSize: width / 19, ), child: AnimatedTextKit( animatedTexts: [ ColorizeAnimatedText( 'Learn', + textStyle: TextStyle( fontSize: width / 12, fontWeight: FontWeight.w900), @@ -66,6 +69,7 @@ class _LandingPageState extends State { child: Text( "Learning Made Easy", style: TextStyle( + fontWeight: FontWeight.w400, fontSize: width / 18), ), ), diff --git a/lib/pages/about.dart b/lib/pages/about.dart index 4221de2..b3c485f 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -2,11 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:learn/utils/constants.dart'; import 'package:url_launcher/url_launcher.dart'; -import '../utils/const_dimensions.dart'; - class AboutPage extends StatelessWidget { const AboutPage({Key? key}) : super(key: key); @@ -16,143 +13,234 @@ class AboutPage extends StatelessWidget { appBar: AppBar( title: const Text( 'About', - style: TextStyle(fontWeight: FontWeight.bold), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white), ), + backgroundColor: Colors.deepPurple, ), body: SingleChildScrollView( child: Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( - 'Learning app for kids', - style: TextStyle( - fontSize: 24.0, - fontWeight: FontWeight.bold, + const Center( + child: Text( + 'Learn', + style: TextStyle( + fontSize: 32.0, + fontWeight: FontWeight.bold, + color: Colors.deepPurple, + ), ), ), - - const SizedBox(height: 16.0), - const Text( - 'Version: 1.1.0', - style: TextStyle(fontSize: 18.0), - ), const SizedBox(height: 8.0), - const Text( - 'Developed by: sapatevaibhav', - style: TextStyle(fontSize: 18.0), + const Center( + child: Text( + 'Learning app for kids', + style: TextStyle( + fontSize: 18.0, + color: Colors.grey, + ), + ), ), + const SizedBox(height: 32.0), + _buildSectionTitle(context, 'Version: 1.1.0'), + const SizedBox(height: 8.0), + _buildSectionContent(context, 'Developed by: sapatevaibhav'), const SizedBox(height: 16.0), - const Text( - 'Description:', - style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - ), + _buildSectionTitle(context, 'Purpose of the App:'), + const SizedBox(height: 8.0), + _buildSectionContent( + context, + 'Learn is designed to provide a fun and interactive learning experience for kids. ' + 'Our mission is to make learning enjoyable and accessible, encouraging curiosity and discovery in young minds. ' + 'The app covers a wide range of topics to help children build a solid foundation of knowledge in a playful and engaging way.', ), + const SizedBox(height: 16.0), + _buildSectionTitle(context, 'Features:'), const SizedBox(height: 8.0), - const Text( - AppConstants.description, - style: TextStyle(fontSize: 18.0), + _buildFeature( + context, + 'A-Z Alphabets', + 'Learn the alphabets with examples and pronunciation guides, making it easier for kids to recognize and remember letters.', ), - const SizedBox(height: 6.0), - const Text( - 'Source code:', - style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - ), + _buildFeature( + context, + 'Animals', + 'Discover animals, hear their sounds, and learn how to pronounce their names, fostering a love for nature and wildlife.', + ), + _buildFeature( + context, + 'Body Parts', + 'Learn about different body parts, how to pronounce them, and gain short information, promoting awareness of their own bodies.', ), + + _buildFeature( + context, + 'Birds', + 'Explore different birds and their voices, adding to the child’s knowledge about avian species.', + ), + _buildFeature( + context, + 'Solar System', + 'Gain knowledge about the solar system, sparking interest in space and astronomy.', + ),const SizedBox(height: 16.0), + _buildSectionTitle(context, 'Upcoming Features:'), + const SizedBox(height: 8.0), + _buildFeature( + context, + 'Shapes', + 'Learn about different shapes and their properties, enhancing cognitive and visual-spatial skills.', + ), + const SizedBox(height: 16.0), + _buildSectionTitle(context, 'Source Code:'), + const SizedBox(height: 8.0), GestureDetector( onTap: () { - _launchURL(context, "https://github.com/VaibhavCodeClub/learn"); + _launchURL( + context, "https://github.com/VaibhavCodeClub/learn"); }, - child: SvgPicture.asset( - 'assets/images/git.svg', - width: 32.0, - height: 32.0, - color: Theme.of(context).brightness == Brightness.dark - ? Colors.white - : Colors.black, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/git.svg', + width: 32.0, + height: 32.0, + color: Theme.of(context).brightness == Brightness.dark + ? Colors.white + : Colors.black, + ), + const SizedBox(width: 8.0), + Text( + 'github.com/VaibhavCodeClub/learn', + style: TextStyle( + fontSize: 16.0, + color: Theme.of(context).brightness == Brightness.dark + ? Colors.white + : Colors.black, + decoration: TextDecoration.underline, + ), + ), + ], ), ), const SizedBox(height: 16.0), - const Text( - 'Connect:', - style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - ), - ), - Row( - children: [ - GestureDetector( - onTap: () { - _launchURL(context, "https://github.com/sapatevaibhav"); - }, - child: SvgPicture.asset( - 'assets/images/github.svg', - width: ConstantDimensions.widthSmall_Medium * 2, - height: ConstantDimensions.heightSmall_Medium * 2, - color: Theme.of(context).brightness == Brightness.dark - ? Colors.white - : Colors.black, - ), - ), - const SizedBox(width: ConstantDimensions.widthSmall_Medium), - GestureDetector( - onTap: () { - _launchURL(context, "mailto:sapatevaibhav@duck.com"); - }, - child: SvgPicture.asset( - 'assets/images/email.svg', - width: ConstantDimensions.widthSmall_Medium * 2, - height: ConstantDimensions.heightSmall_Medium * 2, - color: Theme.of(context).brightness == Brightness.dark - ? Colors.white - : Colors.black , - ), - ), - const SizedBox(width: ConstantDimensions.widthSmall_Medium), - GestureDetector( - onTap: () { - _launchURL( - context, "https://linkedin.com/in/sapatevaibhav"); - }, - child: SvgPicture.asset( - 'assets/images/linkedin.svg', - width: ConstantDimensions.widthSmall_Medium * 2, - height: ConstantDimensions.heightSmall_Medium * 2, + _buildSectionTitle(context, 'Connect:'), + const SizedBox(height: 8.0), + Row( + children: [ + _buildIcon(context, 'https://github.com/sapatevaibhav', + 'assets/images/github.svg'), + const SizedBox(width: 16.0), + _buildIcon(context, 'mailto:sapatevaibhav@duck.com', + 'assets/images/email.svg'), + const SizedBox(width: 16.0), + GestureDetector( + onTap: () { + _launchURL( + context, 'https://linkedin.com/in/sapatevaibhav'); + }, + child: SvgPicture.asset( + 'assets/images/linkedin.svg', + width: 32.0, + height: 32.0, + ), ), - ), - const SizedBox(width: ConstantDimensions.widthSmall_Medium), - GestureDetector( - onTap: () { - _launchURL(context, "https://instagram.com/v.d.r.sapate"); + const SizedBox(width: 16.0), + _buildIcon(context, 'https://instagram.com/v.d.r.sapate', + 'assets/images/instagram.svg'), + ], + ), + const SizedBox(height: 16.0), + Center( + child: ElevatedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const LearnMorePage(), + ), + ); }, - child: SvgPicture.asset( - 'assets/images/instagram.svg', - width: ConstantDimensions.widthSmall_Medium * 2, - height: ConstantDimensions.heightSmall_Medium * 2, - color: Theme.of(context).brightness == Brightness.dark - ? Colors.white - : Colors.black, + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: Colors.deepPurple, + padding: const EdgeInsets.symmetric( + horizontal: 24, vertical: 12), + textStyle: const TextStyle(fontSize: 18.0), ), + child: const Text('Learn More'), ), - - ] - ) - ], - ), + ], ), - ), + ), + ); + } - ); + Widget _buildSectionTitle(BuildContext context, String title) { + return Text( + title, + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.deepPurple, + ), + ); + } + Widget _buildSectionContent(BuildContext context, String content) { + return Text( + content, + style: TextStyle( + fontSize: 16.0, + color: Theme.of(context).textTheme.bodyLarge!.color, + ), + ); + } + + Widget _buildFeature(BuildContext context, String title, String description) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + color: Colors.deepPurple, + ), + ), + const SizedBox(height: 4.0), + Text( + description, + style: TextStyle( + fontSize: 16.0, + color: Theme.of(context).textTheme.bodyLarge!.color, + ), + ), + ], + ), + ); + } + Widget _buildIcon(BuildContext context, String url, String assetPath) { + return GestureDetector( + onTap: () { + _launchURL(context, url); + }, + child: SvgPicture.asset( + assetPath, + width: 32.0, + height: 32.0, + color: Theme.of(context).brightness == Brightness.dark + ? Colors.white + : Colors.black, + ), + ); } void _launchURL(BuildContext context, String url) async { @@ -163,3 +251,137 @@ class AboutPage extends StatelessWidget { } } } + +class LearnMorePage extends StatelessWidget { + const LearnMorePage({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text( + 'Learn More', + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white), + ), + backgroundColor: Colors.deepPurple, + ), + body: SingleChildScrollView( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSectionTitle(context, 'Detailed Features:'), + const SizedBox(height: 8.0), + _buildFeature( + context, + 'A-Z Alphabets', + 'Each letter of the alphabet is accompanied by an example image and pronunciation guide. Children can interact with the letters to hear how they sound, helping them to learn the alphabet in a fun and engaging way.', + ), + _buildFeature( + context, + 'Animals', + 'The animals section introduces children to various animals, providing sounds and fun facts about each one. This feature helps children to develop a love for nature and learn more about the animal kingdom.', + ), + _buildFeature( + context, + 'Body Parts', + 'This feature includes a diagram of the human body with clickable parts that provide information and pronunciation. It helps children to learn about their own bodies and understand the function of each part.', + ), + + _buildFeature( + context, + 'Birds', + 'The upcoming birds section will introduce various birds and their calls, helping children to recognize and learn more about avian species.', + ), + _buildFeature( + context, + 'Solar System', + 'The solar system feature will teach children about the planets and other celestial bodies, fostering an interest in space and astronomy.', + ),const SizedBox(height: 16.0), + _buildSectionTitle(context, 'Upcoming Features:'), + const SizedBox(height: 8.0), + _buildFeature( + context, + 'Shapes', + 'Children will learn about different shapes and their properties, which helps in developing cognitive and visual-spatial skills.', + ), + const SizedBox(height: 16.0), + _buildSectionTitle(context, 'User Guide:'), + const SizedBox(height: 8.0), + _buildSectionContent( + context, + 'Navigate through the app using the bottom navigation bar. Each section is designed to be interactive and user-friendly. Parents can help guide their children through each feature and use the app as a supplementary learning tool.', + ), + const SizedBox(height: 16.0), + _buildSectionTitle(context, 'FAQ:'), + const SizedBox(height: 8.0), + _buildSectionContent( + context, + 'Q: How do I use the app?\n' + 'A: Simply navigate through the sections using the bottom navigation bar. Each section is designed to be intuitive and easy to use.\n\n' + 'Q: Is the app free?\n' + 'A: Yes, the app is free to use.\n\n' + 'Q: How can I provide feedback?\n' + 'A: You can provide feedback through the contact options available in the About section of the app.', + ), + const SizedBox(height: 16.0), + _buildSectionTitle(context, 'Feedback and Contact Information:'), + const SizedBox(height: 8.0), + _buildSectionContent( + context, + 'We value your feedback! If you have any suggestions or issues, please contact us at sapatevaibhav@duck.com or through our social media channels.', + ), + ], + ), + ), + ); + } + + Widget _buildSectionTitle(BuildContext context, String title) { + return Text( + title, + style: const TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.deepPurple, + ), + ); + } + + Widget _buildSectionContent(BuildContext context, String content) { + return Text( + content, + style: TextStyle( + fontSize: 16.0, + color: Theme.of(context).textTheme.bodyLarge!.color, + ), + ); + } + + Widget _buildFeature(BuildContext context, String title, String description) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + color: Colors.deepPurple, + ), + ), + const SizedBox(height: 4.0), + Text( + description, + style: TextStyle( + fontSize: 16.0, + color: Theme.of(context).textTheme.bodyLarge!.color, + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/fruits.dart b/lib/pages/fruits.dart index 9954f88..78ca834 100644 --- a/lib/pages/fruits.dart +++ b/lib/pages/fruits.dart @@ -115,7 +115,7 @@ class _FruitsPageState extends State { ), ElevatedButton( style: ButtonStyle( - fixedSize: MaterialStateProperty.all( + fixedSize: WidgetStateProperty.all( Size(MediaQuery.of(context).size.width * .3, 50))), onPressed: () { if (AppConstants.Fruits[_currentIndex].isfruit == true) { @@ -131,7 +131,7 @@ class _FruitsPageState extends State { ), ElevatedButton( style: ButtonStyle( - fixedSize: MaterialStateProperty.all( + fixedSize: WidgetStateProperty.all( Size(MediaQuery.of(context).size.width * .3, 50))), onPressed: () { if (AppConstants.Fruits[_currentIndex].isfruit == false) { diff --git a/lib/pages/home.dart b/lib/pages/home.dart index dcb346e..3f70e28 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:adaptive_theme/adaptive_theme.dart'; import 'package:flutter/material.dart'; import 'package:learn/utils/assets_path.dart'; diff --git a/lib/pages/main_home.dart b/lib/pages/main_home.dart index 3c38b3d..f9bc566 100644 --- a/lib/pages/main_home.dart +++ b/lib/pages/main_home.dart @@ -12,6 +12,7 @@ import 'package:learn/widgets/navbar/navbar.dart'; class MainHome extends StatefulWidget { final AdaptiveThemeMode? savedThemeMode; + const MainHome({ super.key, this.savedThemeMode, @@ -22,7 +23,7 @@ class MainHome extends StatefulWidget { } class _MainHomeState extends State { - Future _onBackPressed() { + bool _onBackPressed(bool canPop) { DateTime now = DateTime.now(); if (currentBackPressTime == null || now.difference(currentBackPressTime!) > const Duration(seconds: 2)) { @@ -32,15 +33,17 @@ class _MainHomeState extends State { toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, ); - return Future.value(false); + canPop = false; + } else { + canPop = true; } - return Future.value(true); + return canPop; } @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: _onBackPressed, + return PopScope( + onPopInvoked: _onBackPressed, child: AdaptiveTheme( light: ThemeData.light(), dark: ThemeData.dark(), diff --git a/lib/pages/modules/atoz.dart b/lib/pages/modules/atoz.dart index 3dcc04e..e79e827 100644 --- a/lib/pages/modules/atoz.dart +++ b/lib/pages/modules/atoz.dart @@ -268,8 +268,8 @@ class _AtoZState extends State { child: ElevatedButton( style: ButtonStyle( backgroundColor: isTimerEnabled - ? MaterialStateProperty.all(Colors.green) - : MaterialStateProperty.all(Colors.red), + ? WidgetStateProperty.all(Colors.green) + : WidgetStateProperty.all(Colors.red), ), onPressed: () { setState(() { diff --git a/lib/pages/modules/colours.dart b/lib/pages/modules/colours.dart index 5c407ab..a0f068d 100644 --- a/lib/pages/modules/colours.dart +++ b/lib/pages/modules/colours.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:learn/utils/assets_path.dart'; -import '../../utils/const_dimensions.dart'; +// import '../../utils/const_dimensions.dart'; import 'package:learn/models/colours_model.dart'; class ColoursPage extends StatefulWidget { @@ -135,7 +135,7 @@ class _ColoursPageState extends State { children: [ GestureDetector( onTap: _navigateToNextColour, - child: Container( + child: SizedBox( width: double.infinity, height: 300, child: SvgPicture.asset( diff --git a/lib/pages/modules/flowers.dart b/lib/pages/modules/flowers.dart index 075f0d2..f5f51a7 100644 --- a/lib/pages/modules/flowers.dart +++ b/lib/pages/modules/flowers.dart @@ -4,7 +4,7 @@ import 'package:flutter_tts/flutter_tts.dart'; import 'package:learn/models/flower_model.dart'; import 'package:learn/utils/assets_path.dart'; -import '../../utils/const_dimensions.dart'; +// import '../../utils/const_dimensions.dart'; class FlowerPage extends StatefulWidget { const FlowerPage({super.key}); @@ -119,7 +119,7 @@ class _FlowerPageState extends State { children: [ GestureDetector( onTap: _navigateToNextFlower, - child: Container( + child: SizedBox( width: double.infinity, height: 300, child: SvgPicture.asset( diff --git a/lib/pages/modules/seasons.dart b/lib/pages/modules/seasons.dart index 5f4c9c4..cd19bd9 100644 --- a/lib/pages/modules/seasons.dart +++ b/lib/pages/modules/seasons.dart @@ -136,7 +136,7 @@ class _SeasonPopupState extends State { ), ElevatedButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.red), + backgroundColor: WidgetStateProperty.all(Colors.red), ), onPressed: () { Navigator.of(context).pop(); diff --git a/lib/utils/const_dimensions.dart b/lib/utils/const_dimensions.dart index bb30064..8abac52 100644 --- a/lib/utils/const_dimensions.dart +++ b/lib/utils/const_dimensions.dart @@ -1,3 +1,5 @@ +// ignore_for_file: constant_identifier_names + class ConstantDimensions { static const double heightExtraSmall = 6; static const double heightSmall = 10; @@ -15,7 +17,6 @@ class ConstantDimensions { static const double widthLarge = 30; static const double widthExtraLarge = 50; - static const double heightSmallImage = 325; static const double heightBigImage = 350; diff --git a/pubspec.yaml b/pubspec.yaml index a284a1a..b5f6453 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -42,7 +42,7 @@ dependencies: card_swiper: ^3.0.1 flutter_card_swiper: ^7.0.0 adaptive_theme: ^3.6.0 - fluttertoast: ^8.2.5 + fluttertoast: 8.0.9 google_nav_bar: ^5.0.6 flutter_bloc: ^8.1.5 animated_text_kit: ^4.2.2