diff --git a/assets/images/quiz.jpg b/assets/images/quiz.jpg new file mode 100644 index 0000000..1cad405 Binary files /dev/null and b/assets/images/quiz.jpg differ diff --git a/lib/main.dart b/lib/main.dart index e252017..0061904 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,7 +7,7 @@ import 'package:learn/pages/modules/atoz.dart'; import 'package:learn/pages/modules/birds.dart'; import 'package:learn/pages/modules/animals.dart'; import 'package:learn/pages/fruits.dart'; -import 'package:learn/pages/explore/explore.dart'; +import 'package:learn/pages/explore.dart'; import 'package:learn/pages/favorite.dart'; import 'package:learn/pages/modules/occupation.dart'; import 'package:learn/pages/modules/parts.dart'; @@ -72,8 +72,8 @@ class MyApp extends StatelessWidget { AllRoutes.flowerRoute: (context) => const FlowerPage(), AllRoutes.exploreRoute: (context) => const ExplorePage(), AllRoutes.favoriteRoute: (context) => const FavoritePage(), - AllRoutes.quizRoute: (context) => QuizPage(), - AllRoutes.seasonRoute: (context) => SeasonsPage(), + AllRoutes.quizRoute: (context) => const QuizPage(), + AllRoutes.seasonRoute: (context) => const SeasonsPage(), AllRoutes.occupationRoute: (context) => OccupationPage(), AllRoutes.fruitRoute: (context) => FruitsPage(), }, diff --git a/lib/pages/about.dart b/lib/pages/about.dart index 567cc83..19e85ab 100644 --- a/lib/pages/about.dart +++ b/lib/pages/about.dart @@ -1,3 +1,5 @@ +// ignore_for_file: deprecated_member_use + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:learn/utils/constants.dart'; diff --git a/lib/pages/explore.dart b/lib/pages/explore.dart index beca601..6d398be 100644 --- a/lib/pages/explore.dart +++ b/lib/pages/explore.dart @@ -1,7 +1,5 @@ import 'dart:ui'; - import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:learn/utils/constants.dart'; // Explore Page @@ -112,39 +110,39 @@ class ExplorePage extends StatelessWidget { childCount: AppConstants.modules.length, ), ), - GestureDetector( - onTap: () { - Navigator.pushNamed(context, '/quiz'); - }, - child: Container( - margin: const EdgeInsets.all(5.0), - padding: const EdgeInsets.all(8.0), - decoration: BoxDecoration( - border: Border.all(color: Colors.black, width: 1.0), - borderRadius: BorderRadius.circular(8.0), - color: Colors.blueAccent, - ), - child: Row( - children: [ - SizedBox( - width: 50, - height: 50, - child: SvgPicture.asset('assets/explore/notebook.svg'), - ), - const SizedBox(width: 28.0), - const Text( - 'Quiz', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 30.0, - fontFamily: 'Comic', - color: Colors.white, - ), - ), - ], - ), - ), - ), + // GestureDetector( + // onTap: () { + // Navigator.pushNamed(context, '/quiz'); + // }, + // child: Container( + // margin: const EdgeInsets.all(5.0), + // padding: const EdgeInsets.all(8.0), + // decoration: BoxDecoration( + // border: Border.all(color: Colors.black, width: 1.0), + // borderRadius: BorderRadius.circular(8.0), + // color: Colors.blueAccent, + // ), + // child: Row( + // children: [ + // SizedBox( + // width: 50, + // height: 50, + // child: SvgPicture.asset('assets/explore/notebook.svg'), + // ), + // const SizedBox(width: 28.0), + // const Text( + // 'Quiz', + // style: TextStyle( + // fontWeight: FontWeight.bold, + // fontSize: 30.0, + // fontFamily: 'Comic', + // color: Colors.white, + // ), + // ), + // ], + // ), + // ), + // ), ], )); } diff --git a/lib/pages/explore/quiz.dart b/lib/pages/explore/quiz.dart index be0516d..2af36f2 100644 --- a/lib/pages/explore/quiz.dart +++ b/lib/pages/explore/quiz.dart @@ -1,5 +1,6 @@ +// ignore_for_file: library_private_types_in_public_api + import 'package:flutter/material.dart'; -import 'dart:math'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:learn/utils/constants.dart'; diff --git a/lib/pages/favorite.dart b/lib/pages/favorite.dart index bebd58d..092b179 100644 --- a/lib/pages/favorite.dart +++ b/lib/pages/favorite.dart @@ -5,12 +5,12 @@ class FavoritePage extends StatelessWidget { // Favorite Page // All the favorited modules by the user will be placed here - // TODO: Implement the Favorite Page + // todo: Implement the Favorite Page @override Widget build(BuildContext context) { - return Center( + return const Center( child: Text("Favorited Items here"), ); } -} \ No newline at end of file +} diff --git a/lib/pages/modules/colours.dart b/lib/pages/modules/colours.dart index 7558e6c..d7078ae 100644 --- a/lib/pages/modules/colours.dart +++ b/lib/pages/modules/colours.dart @@ -1,3 +1,5 @@ +// ignore_for_file: library_private_types_in_public_api + import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -131,7 +133,7 @@ class _ColoursPageState extends State { children: [ GestureDetector( onTap: _navigateToNextColour, - child: Container( + child: SizedBox( width: double.infinity, height: 300, child: SvgPicture.asset( @@ -188,5 +190,4 @@ class _ColoursPageState extends State { ), ); } - } diff --git a/lib/pages/modules/flowers.dart b/lib/pages/modules/flowers.dart index 61f4a92..35721f3 100644 --- a/lib/pages/modules/flowers.dart +++ b/lib/pages/modules/flowers.dart @@ -116,7 +116,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/parts.dart b/lib/pages/modules/parts.dart index 34a6708..aa28642 100644 --- a/lib/pages/modules/parts.dart +++ b/lib/pages/modules/parts.dart @@ -1,6 +1,4 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_card_swiper/flutter_card_swiper.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_tts/flutter_tts.dart'; @@ -71,56 +69,57 @@ class _PartsPagePageState extends State { child: Column( children: [ Expanded( - child: ResponsiveScreenProvider.isMobileScreen(context)?CardSwiper( - controller: controller, - cardsCount: cards.length, - onSwipe: (prevIndex, currentIndex, direction) { - setState(() { - previousIndices.add(topCardIndex); - topCardIndex = currentIndex ?? 0; - }); - return true; - }, - onUndo: _onUndo, - numberOfCardsDisplayed: 3, - backCardOffset: const Offset(40, 40), - padding: const EdgeInsets.all(24.0), - cardBuilder: ( - context, - index, - horizontalThresholdPercentage, - verticalThresholdPercentage, - ) => - cards[index], - ) : - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.4, - width: MediaQuery.of(context).size.height * 0.6, - child: CardSwiper( - controller: controller, - cardsCount: cards.length, - onSwipe: (prevIndex, currentIndex, direction) { - setState(() { - previousIndices.add(topCardIndex); - topCardIndex = currentIndex ?? 0; - }); - return true; - }, - onUndo: _onUndo, - numberOfCardsDisplayed: 3, - backCardOffset: const Offset(40, 40), - padding: const EdgeInsets.all(24.0), - cardBuilder: ( - context, - index, - horizontalThresholdPercentage, - verticalThresholdPercentage, - ) => - cards[index], - ), - ), - ), + child: ResponsiveScreenProvider.isMobileScreen(context) + ? CardSwiper( + controller: controller, + cardsCount: cards.length, + onSwipe: (prevIndex, currentIndex, direction) { + setState(() { + previousIndices.add(topCardIndex); + topCardIndex = currentIndex ?? 0; + }); + return true; + }, + onUndo: _onUndo, + numberOfCardsDisplayed: 3, + backCardOffset: const Offset(40, 40), + padding: const EdgeInsets.all(24.0), + cardBuilder: ( + context, + index, + horizontalThresholdPercentage, + verticalThresholdPercentage, + ) => + cards[index], + ) + : Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.4, + width: MediaQuery.of(context).size.height * 0.6, + child: CardSwiper( + controller: controller, + cardsCount: cards.length, + onSwipe: (prevIndex, currentIndex, direction) { + setState(() { + previousIndices.add(topCardIndex); + topCardIndex = currentIndex ?? 0; + }); + return true; + }, + onUndo: _onUndo, + numberOfCardsDisplayed: 3, + backCardOffset: const Offset(40, 40), + padding: const EdgeInsets.all(24.0), + cardBuilder: ( + context, + index, + horizontalThresholdPercentage, + verticalThresholdPercentage, + ) => + cards[index], + ), + ), + ), ), Expanded( child: Padding( diff --git a/lib/pages/modules/planets.dart b/lib/pages/modules/planets.dart index 0ec51a7..074179c 100644 --- a/lib/pages/modules/planets.dart +++ b/lib/pages/modules/planets.dart @@ -1,3 +1,5 @@ +// ignore_for_file: library_private_types_in_public_api + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_tts/flutter_tts.dart'; diff --git a/lib/pages/modules/seasons.dart b/lib/pages/modules/seasons.dart index 3164c01..94ca8c3 100644 --- a/lib/pages/modules/seasons.dart +++ b/lib/pages/modules/seasons.dart @@ -1,10 +1,12 @@ +// ignore_for_file: library_private_types_in_public_api + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:learn/models/season_model.dart'; import 'package:learn/utils/constants.dart'; class SeasonsPage extends StatelessWidget { - SeasonsPage({Key? key}) : super(key: key); + const SeasonsPage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -73,7 +75,8 @@ class SeasonPopup extends StatefulWidget { final int currentIndex; final List seasons; - SeasonPopup({ + const SeasonPopup({ + super.key, required this.currentIndex, required this.seasons, }); diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index 66906c7..253e5bf 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -1,25 +1,13 @@ -import 'dart:ui'; +// ignore_for_file: non_constant_identifier_names, constant_identifier_names import 'package:learn/models/animal_model.dart'; import 'package:learn/models/bird_model.dart'; import 'package:learn/models/itemdata_model.dart'; import 'package:learn/models/occupation_model.dart'; import 'package:learn/models/season_model.dart'; - -import 'package:flutter/material.dart'; -import 'package:learn/pages/fruits.dart'; - import 'package:flutter/material.dart'; import 'package:learn/pages/fruits.dart'; - -import 'package:flutter/material.dart'; -import 'package:learn/pages/fruits.dart'; - -import 'package:flutter/material.dart'; -import 'package:learn/pages/fruits.dart'; - import '../pages/explore/quiz.dart'; -import 'package:flutter/material.dart'; import 'package:learn/pages/modules/colours.dart'; import 'package:learn/pages/modules/parts.dart'; import 'package:learn/pages/modules/planets.dart'; @@ -31,11 +19,16 @@ import 'package:learn/utils/assets_path.dart'; import '../pages/modules/animals.dart'; import '../pages/modules/atoz.dart'; import '../pages/modules/birds.dart'; -import '../pages/modules/seasons.dart'; -import '../pages/modules/occupation.dart'; class AppConstants { static List modules = [ + Module( + name: 'Quiz', + description: 'Fun Quizzes for Curious Kids!', + thumbnailPath: "./assets/images/quiz.jpg", + route: MaterialPageRoute(builder: (context) => const QuizPage()), + backgroundColor: const Color.fromARGB(193, 76, 175, 79), + ), Module( name: 'A-Z', description: 'Learn A to Z with production and an example',