Skip to content

Commit

Permalink
changed quiz cover and solved problems
Browse files Browse the repository at this point in the history
  • Loading branch information
hiranj-kotak committed May 25, 2024
1 parent 17323a4 commit 4e0b676
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 114 deletions.
Binary file added assets/images/quiz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(),
},
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/about.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
68 changes: 33 additions & 35 deletions lib/pages/explore.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
// ),
// ),
// ],
// ),
// ),
// ),
],
));
}
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/explore/quiz.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
6 changes: 3 additions & 3 deletions lib/pages/favorite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
);
}
}
}
5 changes: 3 additions & 2 deletions lib/pages/modules/colours.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -131,7 +133,7 @@ class _ColoursPageState extends State<ColoursPage> {
children: [
GestureDetector(
onTap: _navigateToNextColour,
child: Container(
child: SizedBox(
width: double.infinity,
height: 300,
child: SvgPicture.asset(
Expand Down Expand Up @@ -188,5 +190,4 @@ class _ColoursPageState extends State<ColoursPage> {
),
);
}

}
2 changes: 1 addition & 1 deletion lib/pages/modules/flowers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class _FlowerPageState extends State<FlowerPage> {
children: [
GestureDetector(
onTap: _navigateToNextFlower,
child: Container(
child: SizedBox(
width: double.infinity,
height: 300,
child: SvgPicture.asset(
Expand Down
103 changes: 51 additions & 52 deletions lib/pages/modules/parts.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -71,56 +69,57 @@ class _PartsPagePageState extends State<PartsPage> {
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(
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/modules/planets.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 5 additions & 2 deletions lib/pages/modules/seasons.dart
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -73,7 +75,8 @@ class SeasonPopup extends StatefulWidget {
final int currentIndex;
final List<Season> seasons;

SeasonPopup({
const SeasonPopup({
super.key,
required this.currentIndex,
required this.seasons,
});
Expand Down
23 changes: 8 additions & 15 deletions lib/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<Module> 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',
Expand Down

0 comments on commit 4e0b676

Please sign in to comment.