From 7b03e50457e6090da5753605e8ae58d0ccb54a31 Mon Sep 17 00:00:00 2001 From: Hetkumar Prajapati Date: Wed, 29 May 2024 07:32:12 +0530 Subject: [PATCH 1/5] (A-Zpage) overflow-fixed --- lib/pages/modules/atoz.dart | 164 ++++++++++++++++++------------------ 1 file changed, 81 insertions(+), 83 deletions(-) diff --git a/lib/pages/modules/atoz.dart b/lib/pages/modules/atoz.dart index 219cc01..3dcc04e 100644 --- a/lib/pages/modules/atoz.dart +++ b/lib/pages/modules/atoz.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'dart:async'; @@ -38,7 +37,7 @@ class ItemTile extends StatelessWidget { ); }, child: Padding( - padding: const EdgeInsets.all(6), + padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 5), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.stretch, @@ -51,27 +50,25 @@ class ItemTile extends StatelessWidget { ), textAlign: TextAlign.center, ), - const SizedBox(height: 3), LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints){ - if (MediaQuery.of(context).orientation == - Orientation.portrait) { - return SvgPicture.asset( - item.iconAsset, - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.width * 0.3, - alignment: Alignment.center, - ); - } else { - return SvgPicture.asset( - item.iconAsset, - width: MediaQuery.of(context).size.width * 0.3, - height: MediaQuery.of(context).size.width * 0.2, - alignment: Alignment.center, - ); - } + builder: (BuildContext context, BoxConstraints constraints) { + if (MediaQuery.of(context).orientation == + Orientation.portrait) { + return SvgPicture.asset( + item.iconAsset, + width: MediaQuery.of(context).size.width * 0.2, + height: MediaQuery.of(context).size.height * 0.1, + alignment: Alignment.center, + ); + } else { + return SvgPicture.asset( + item.iconAsset, + width: MediaQuery.of(context).size.width * 0.2, + height: MediaQuery.of(context).size.height * 0.2, + alignment: Alignment.center, + ); } - ), + }), const SizedBox(height: ConstantDimensions.heightExtraSmall / 2), Text(item.description, textAlign: TextAlign.center), ], @@ -163,80 +160,81 @@ class _PopupDialogState extends State<_PopupDialog> { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), content: Container( padding: EdgeInsets.zero, - width: MediaQuery.of(context).size.width * 0.7, + width: MediaQuery.of(context).size.width * 0.75, + height: MediaQuery.of(context).size.height * 0.75, decoration: BoxDecoration( color: currentItem.backgroundColor, borderRadius: BorderRadius.circular(15)), child: Padding( - padding: const EdgeInsets.all(20), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - currentItem.title, - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 40, + padding: const EdgeInsets.all(18), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + currentItem.title, + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 40, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - ), - const SizedBox(height: ConstantDimensions.heightMedium), - GestureDetector( - onTap: () { - _speakText(currentItem.description); - }, - child: SvgPicture.asset( - currentItem.iconAsset, - width: MediaQuery.of(context).size.width * 0.5, - height: MediaQuery.of(context).size.width * 0.5, - alignment: Alignment.center, + const SizedBox(height: ConstantDimensions.heightMedium), + GestureDetector( + onTap: () { + _speakText(currentItem.description); + }, + child: SvgPicture.asset( + currentItem.iconAsset, + width: MediaQuery.of(context).size.width * 0.5, + height: MediaQuery.of(context).size.height * 0.3, + alignment: Alignment.center, + ), ), - ), - const SizedBox(height: ConstantDimensions.heightMedium), - Text( - currentItem.description, - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 28, - - ), - ), - const SizedBox(height: ConstantDimensions.heightMedium), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ElevatedButton( - onPressed: _previousItem, - child: const Text('Prev'), + const SizedBox(height: ConstantDimensions.heightMedium), + Text( + currentItem.description, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 28, + ), ), - ElevatedButton( - onPressed: _nextItem, - child: const Text('Next'), + const SizedBox(height: ConstantDimensions.heightMedium), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ElevatedButton( + onPressed: _previousItem, + child: const Text('Prev'), + ), + ElevatedButton( + onPressed: _nextItem, + child: const Text('Next'), + ), + ], ), - ], - ), - const SizedBox(height: ConstantDimensions.heightMedium), - ElevatedButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - const Color.fromARGB(216, 233, 101, 92), + const SizedBox(height: ConstantDimensions.heightMedium), + ElevatedButton( + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all( + const Color.fromARGB(216, 233, 101, 92), + ), + ), + onPressed: () { + Navigator.pop(context); + }, + child: const Text( + 'Close', + style: TextStyle(color: Colors.white), + ), ), - ), - onPressed: () { - Navigator.pop(context); - }, - child: const Text( - 'Close', - style: TextStyle(color: Colors.white), - ), + ], ), - const SizedBox(height: ConstantDimensions.heightExtraLarge), - ], + ), ), ), ), - ) ); } } @@ -293,7 +291,7 @@ class _AtoZState extends State { child: GridView.count( crossAxisCount: MediaQuery.of(context).size.width ~/ 200, // Adjust the value based on screen width - childAspectRatio: 1.0, // Aspect ratio of items + childAspectRatio: 0.8, // Aspect ratio of items children: List.generate( items.length, (index) => ItemTile( From 2003a978b4e32726b425eca5cdb8339e2d69deeb Mon Sep 17 00:00:00 2001 From: Hetkumar Prajapati Date: Fri, 31 May 2024 12:27:40 +0530 Subject: [PATCH 2/5] confiltResolved --- lib/pages/modules/atoz.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(() { From 82484e71f0888462b795f6c699676db2c81db63e Mon Sep 17 00:00:00 2001 From: Hetkumar Prajapati Date: Fri, 31 May 2024 12:38:52 +0530 Subject: [PATCH 3/5] solved --- lib/pages/modules/atoz.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/modules/atoz.dart b/lib/pages/modules/atoz.dart index e79e827..7a5d56a 100644 --- a/lib/pages/modules/atoz.dart +++ b/lib/pages/modules/atoz.dart @@ -110,7 +110,7 @@ class _PopupDialogState extends State<_PopupDialog> { _speakDescription(); if (isAutoNextEnabled) { - timer = Timer.periodic(const Duration(seconds: 3), (Timer t) { + timer = Timer.periodic(const Duration(seconds: 2), (Timer t) { _nextItem(); }); } From fdf6218c3f68cc58e27b6b0cd3097fc861cd91a0 Mon Sep 17 00:00:00 2001 From: Hetkumar Prajapati Date: Fri, 31 May 2024 12:46:02 +0530 Subject: [PATCH 4/5] packageupdated --- pubspec.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index b5f6453..430862d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: learn description: "Learning app for kids" # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.1.0+15 environment: - sdk: '>=3.2.0 <4.0.0' + sdk: ">=3.2.0 <4.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -31,7 +31,6 @@ dependencies: flutter: sdk: flutter - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. google_fonts: ^6.1.0 @@ -42,7 +41,7 @@ dependencies: card_swiper: ^3.0.1 flutter_card_swiper: ^7.0.0 adaptive_theme: ^3.6.0 - fluttertoast: 8.0.9 + fluttertoast: ^8.2.5 google_nav_bar: ^5.0.6 flutter_bloc: ^8.1.5 animated_text_kit: ^4.2.2 @@ -63,7 +62,6 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. From 54215bd108b5167a2045d3cde098ffba805e5929 Mon Sep 17 00:00:00 2001 From: Hetkumar Prajapati Date: Sun, 2 Jun 2024 08:42:25 +0530 Subject: [PATCH 5/5] uifixed --- lib/pages/modules/animals.dart | 28 ++++++++++++++-------------- lib/pages/modules/atoz.dart | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/pages/modules/animals.dart b/lib/pages/modules/animals.dart index 81fe262..c40495b 100644 --- a/lib/pages/modules/animals.dart +++ b/lib/pages/modules/animals.dart @@ -10,8 +10,6 @@ import 'package:learn/utils/constants.dart'; import '../../utils/const_dimensions.dart'; class AnimalsPage extends StatelessWidget { - - final FlutterTts flutterTts = FlutterTts(); final AudioPlayer audioPlayer = AudioPlayer(); @@ -31,7 +29,7 @@ class AnimalsPage extends StatelessWidget { itemBuilder: (context, index) { return GestureDetector( onTap: () { - _showAnimalPopup(context, AppConstants.animals[index],index); + _showAnimalPopup(context, AppConstants.animals[index], index); }, child: Container( margin: const EdgeInsets.all(5.0), @@ -46,7 +44,8 @@ class AnimalsPage extends StatelessWidget { SizedBox( width: ConstantDimensions.widthExtraLarge, height: ConstantDimensions.heightExtraLarge, - child: SvgPicture.asset(AppConstants.animals[index].svgAsset), + child: + SvgPicture.asset(AppConstants.animals[index].svgAsset), ), const SizedBox(width: ConstantDimensions.widthMedium_Large), Text( @@ -66,7 +65,8 @@ class AnimalsPage extends StatelessWidget { ); } - Future _showAnimalPopup(BuildContext context, Animal animal, int currentIndex) async { + Future _showAnimalPopup( + BuildContext context, Animal animal, int currentIndex) async { await flutterTts.setVolume(1.0); await flutterTts.setSpeechRate(.5); await flutterTts.setLanguage("EN-IN"); @@ -140,13 +140,11 @@ class _AnimalPopupState extends State { isTapped = !isTapped; }); }, - child: SizedBox( - width: ConstantDimensions.widthExtraLarge * 4, - height: ConstantDimensions.heightExtraLarge * 4, - child: SvgPicture.asset( - widget.animal.svgAsset, - color: isTapped ? const Color.fromARGB(81, 118, 96, 94) : null, - ), + child: SvgPicture.asset( + widget.animal.svgAsset, + color: isTapped ? const Color.fromARGB(81, 118, 96, 94) : null, + width: MediaQuery.of(context).size.width * 0.3, + height: MediaQuery.of(context).size.height * 0.3, ), ), const SizedBox(height: ConstantDimensions.heightSmall_Medium), @@ -157,12 +155,14 @@ class _AnimalPopupState extends State { child: const Text('Play Sound'), ), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( onPressed: () { _navigateToPreviousAnimal(); }, icon: const Icon(Icons.arrow_back), + iconSize: 30, ), SizedBox( width: ConstantDimensions.exceptions[0], @@ -172,6 +172,7 @@ class _AnimalPopupState extends State { _navigateToNextAnimal(); }, icon: const Icon(Icons.arrow_forward), + iconSize: 30, ), ], ) @@ -195,7 +196,7 @@ class _AnimalPopupState extends State { ); } -void _navigateToPreviousAnimal() { + void _navigateToPreviousAnimal() { setState(() { widget.currentIndex = (widget.currentIndex - 1) % widget.animals.length; if (widget.currentIndex < 0) { @@ -212,7 +213,6 @@ void _navigateToPreviousAnimal() { }); } - Future _playAnimalSound(String soundAsset) async { await widget.audioPlayer.setAsset(soundAsset); await widget.audioPlayer.play(); diff --git a/lib/pages/modules/atoz.dart b/lib/pages/modules/atoz.dart index 7a5d56a..ba6fea6 100644 --- a/lib/pages/modules/atoz.dart +++ b/lib/pages/modules/atoz.dart @@ -110,7 +110,7 @@ class _PopupDialogState extends State<_PopupDialog> { _speakDescription(); if (isAutoNextEnabled) { - timer = Timer.periodic(const Duration(seconds: 2), (Timer t) { + timer = Timer.periodic(const Duration(seconds: 3), (Timer t) { _nextItem(); }); } @@ -154,20 +154,20 @@ class _PopupDialogState extends State<_PopupDialog> { @override Widget build(BuildContext context) { final currentItem = widget.items[currentIndex]; - return SingleChildScrollView( - child: AlertDialog( - contentPadding: EdgeInsets.zero, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), - content: Container( - padding: EdgeInsets.zero, - width: MediaQuery.of(context).size.width * 0.75, - height: MediaQuery.of(context).size.height * 0.75, - decoration: BoxDecoration( - color: currentItem.backgroundColor, - borderRadius: BorderRadius.circular(15)), - child: Padding( - padding: const EdgeInsets.all(18), - child: Center( + return AlertDialog( + contentPadding: EdgeInsets.zero, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)), + content: Container( + padding: EdgeInsets.zero, + width: MediaQuery.of(context).size.width * 0.75, + height: MediaQuery.of(context).size.height * 0.75, + decoration: BoxDecoration( + color: currentItem.backgroundColor, + borderRadius: BorderRadius.circular(15)), + child: Padding( + padding: const EdgeInsets.all(18), + child: Center( + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min,