diff --git a/assets/Greetings/all_the_best.jpg b/assets/Greetings/all_the_best.jpg
new file mode 100644
index 0000000..0ae1c3a
Binary files /dev/null and b/assets/Greetings/all_the_best.jpg differ
diff --git a/assets/Greetings/all_the_best.svg b/assets/Greetings/all_the_best.svg
new file mode 100644
index 0000000..fc141cd
--- /dev/null
+++ b/assets/Greetings/all_the_best.svg
@@ -0,0 +1,872 @@
+
+
diff --git a/assets/Greetings/congrats.jpg b/assets/Greetings/congrats.jpg
new file mode 100644
index 0000000..7abd497
Binary files /dev/null and b/assets/Greetings/congrats.jpg differ
diff --git a/assets/Greetings/congrats.svg b/assets/Greetings/congrats.svg
new file mode 100644
index 0000000..5843d2e
--- /dev/null
+++ b/assets/Greetings/congrats.svg
@@ -0,0 +1,131 @@
+
+
diff --git a/assets/Greetings/greetings_cover.jpg b/assets/Greetings/greetings_cover.jpg
new file mode 100644
index 0000000..c54fc41
Binary files /dev/null and b/assets/Greetings/greetings_cover.jpg differ
diff --git a/assets/Greetings/hi.jpg b/assets/Greetings/hi.jpg
new file mode 100644
index 0000000..863afa4
Binary files /dev/null and b/assets/Greetings/hi.jpg differ
diff --git a/assets/Greetings/hi.mp3 b/assets/Greetings/hi.mp3
new file mode 100644
index 0000000..c083d62
Binary files /dev/null and b/assets/Greetings/hi.mp3 differ
diff --git a/assets/Greetings/hi.svg b/assets/Greetings/hi.svg
new file mode 100644
index 0000000..ad8325a
--- /dev/null
+++ b/assets/Greetings/hi.svg
@@ -0,0 +1,134 @@
+
+
diff --git a/assets/Greetings/please.jpg b/assets/Greetings/please.jpg
new file mode 100644
index 0000000..8ce0604
Binary files /dev/null and b/assets/Greetings/please.jpg differ
diff --git a/assets/Greetings/please.svg b/assets/Greetings/please.svg
new file mode 100644
index 0000000..35207fb
--- /dev/null
+++ b/assets/Greetings/please.svg
@@ -0,0 +1,94 @@
+
+
diff --git a/assets/Greetings/say_cheese.svg b/assets/Greetings/say_cheese.svg
new file mode 100644
index 0000000..c5ede82
--- /dev/null
+++ b/assets/Greetings/say_cheese.svg
@@ -0,0 +1,1020 @@
+
+
diff --git a/assets/Greetings/say_cheeze.jpg b/assets/Greetings/say_cheeze.jpg
new file mode 100644
index 0000000..f5387be
Binary files /dev/null and b/assets/Greetings/say_cheeze.jpg differ
diff --git a/assets/Greetings/sorry.jpg b/assets/Greetings/sorry.jpg
new file mode 100644
index 0000000..b77a9a2
Binary files /dev/null and b/assets/Greetings/sorry.jpg differ
diff --git a/assets/Greetings/sorry.svg b/assets/Greetings/sorry.svg
new file mode 100644
index 0000000..532de48
--- /dev/null
+++ b/assets/Greetings/sorry.svg
@@ -0,0 +1,2458 @@
+
+
diff --git a/lib/main.dart b/lib/main.dart
index 8739239..9c030b7 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -2,13 +2,14 @@ import 'package:flutter/material.dart';
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:learn/pages/about.dart';
-import 'package:learn/pages/modules/flowers.dart';
+import 'package:learn/pages/explore/quiz.dart';
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.dart';
import 'package:learn/pages/favorite.dart';
+import 'package:learn/pages/modules/flowers.dart';
+import 'package:learn/pages/modules/greetings.dart';
import 'package:learn/pages/modules/occupation.dart';
import 'package:learn/pages/modules/parts.dart';
import 'package:learn/pages/modules/seasons.dart';
@@ -19,9 +20,7 @@ import 'package:learn/pages/modules/colours.dart';
import 'package:learn/widgets/navbar/navbar.dart';
import 'cubit/index_cubit.dart';
-import 'pages/explore/quiz.dart';
import 'pages/home.dart';
-import 'landing_page.dart';
DateTime? currentBackPressTime;
@@ -51,7 +50,6 @@ class MyApp extends StatelessWidget {
title: 'Home',
theme: theme,
darkTheme: darkTheme,
- initialRoute: '/landing_page',
home: Scaffold(
body: const [
MyHomePage(),
@@ -74,11 +72,10 @@ class MyApp extends StatelessWidget {
AllRoutes.flowerRoute: (context) => const FlowerPage(),
AllRoutes.exploreRoute: (context) => const ExplorePage(),
AllRoutes.favoriteRoute: (context) => const FavoritePage(),
- AllRoutes.quizRoute: (context) => const QuizPage(),
- AllRoutes.seasonRoute: (context) => const SeasonsPage(),
+ AllRoutes.quizRoute: (context) => QuizPage(),
+ AllRoutes.seasonRoute: (context) => SeasonsPage(),
AllRoutes.occupationRoute: (context) => OccupationPage(),
- AllRoutes.fruitRoute: (context) => FruitsPage(),
- "/landing_page": (context) => const LandingPage(),
+ AllRoutes.greetingsRoute:(context) => GreetingsPage(),
},
);
},
diff --git a/lib/pages/home.dart b/lib/pages/home.dart
index bf0100a..e65634e 100644
--- a/lib/pages/home.dart
+++ b/lib/pages/home.dart
@@ -141,12 +141,24 @@ class _MyHomePageState extends State {
categoryCard(
context: context,
title: "FRUITS & VEGETABLES",
- image: 'assets/fruitsVeges/cover.jpg',
+ image: 'assets/fruitsVeges/cover.jpg',
shortDescription:
- "Explore and learn about Fruits and Vegetables!",
+ "Learn about different types of expressions",
route: AllRoutes.fruitRoute,
index: 6,
),
+ const SizedBox(
+ height: ConstantDimensions.heightMedium,
+ ),
+ categoryCard(
+ context: context,
+ title: "Greetings",
+ image: 'assets/Greetings/greetings_cover.jpg',
+ shortDescription:
+ "Learn about differnet types of expressions",
+ route: AllRoutes.greetingsRoute,
+ index: 6,
+ ),
],
),
),
diff --git a/lib/pages/modules/greetings.dart b/lib/pages/modules/greetings.dart
new file mode 100644
index 0000000..4ef5347
--- /dev/null
+++ b/lib/pages/modules/greetings.dart
@@ -0,0 +1,210 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_tts/flutter_tts.dart';
+import 'package:just_audio/just_audio.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+
+import '../../utils/constants.dart';
+
+class Greetings {
+ final String name;
+ final String imgAsset;
+ final String soundAsset;
+ final Color backgroundColor;
+
+ Greetings({
+ required this.name,
+ required this.imgAsset,
+ required this.soundAsset,
+ required this.backgroundColor,
+ });
+}
+
+class AppConstants {
+ static const String greetings = 'Greetings';
+ static final List greetingList = [
+ Greetings(
+ name: 'Hello',
+ imgAsset: 'assets/Greetings/hi.svg',
+ soundAsset: 'assets/sounds/hi.mp3',
+ backgroundColor: Colors.white,
+ ),
+ Greetings(
+ name: 'Say Cheese',
+ imgAsset: 'assets/Greetings/say_cheese.svg',
+ soundAsset: 'assets/sounds/good_morning.mp3',
+ backgroundColor: Colors.orange,
+ ),
+ Greetings(
+ name: 'Best of Luck',
+ imgAsset: 'assets/Greetings/all_the_best.svg',
+ soundAsset: 'assets/sounds/good_night.mp3',
+ backgroundColor: Colors.blue,
+ ),
+ Greetings(
+ name: 'Sorry',
+ imgAsset: 'assets/Greetings/sorry.svg',
+ soundAsset: 'assets/sounds/good_night.mp3',
+ backgroundColor: Colors.orange,
+ ),
+ Greetings(
+ name: 'Please',
+ imgAsset: 'assets/Greetings/please.svg',
+ soundAsset: 'assets/sounds/good_night.mp3',
+ backgroundColor: Colors.blue,
+ ),
+ Greetings(
+ name: 'Congratulations',
+ imgAsset: 'assets/Greetings/congrats.svg',
+ soundAsset: 'assets/sounds/good_night.mp3',
+ backgroundColor: Colors.red,
+ ),
+ ];
+}
+
+class GreetingsPage extends StatelessWidget {
+ final FlutterTts flutterTts = FlutterTts();
+ final AudioPlayer audioPlayer = AudioPlayer();
+
+ GreetingsPage({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: const Text(
+ AppConstants.greetings,
+ style: TextStyle(fontWeight: FontWeight.bold),
+ ),
+ ),
+ body: Center(
+ child: GreetingsWidget(
+ greetings: AppConstants.greetingList,
+ flutterTts: flutterTts,
+ audioPlayer: audioPlayer,
+ ),
+ ),
+ );
+ }
+}
+
+class GreetingsWidget extends StatefulWidget {
+ final List greetings;
+ final FlutterTts flutterTts;
+ final AudioPlayer audioPlayer;
+
+ GreetingsWidget({
+ required this.greetings,
+ required this.flutterTts,
+ required this.audioPlayer,
+ });
+
+ @override
+ _GreetingsWidgetState createState() => _GreetingsWidgetState();
+}
+
+class _GreetingsWidgetState extends State {
+ int currentIndex = 0;
+
+ void _navigateToNextGreeting() {
+ setState(() {
+ currentIndex = (currentIndex + 1) % widget.greetings.length;
+ });
+ }
+
+ void _navigateToPreviousGreeting() {
+ setState(() {
+ currentIndex = (currentIndex - 1 + widget.greetings.length) % widget.greetings.length;
+ });
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ Greetings greeting = widget.greetings[currentIndex];
+ return SingleChildScrollView(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ GestureDetector(
+ onTap: _navigateToNextGreeting,
+ child: Container(
+ width: 375,
+ height: 375,
+ decoration: BoxDecoration(
+ border: Border.all(color: Colors.black),
+ borderRadius: BorderRadius.circular(8.0),
+ color: greeting.backgroundColor,
+ ),
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SizedBox(
+ width: 350,
+ height: 350,
+ child: greeting.imgAsset.endsWith('.svg')
+ ? SvgPicture.asset(greeting.imgAsset)
+ : Image.asset(greeting.imgAsset),
+ ),
+ ],
+ ),
+ ),
+ ),
+ const SizedBox(height: 20),
+ Text(
+ greeting.name,
+ style: const TextStyle(
+ fontWeight: FontWeight.bold,
+ fontSize: 45,
+ fontFamily: 'Comic',
+ ),
+ ),
+ const SizedBox(height: 40),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ IconButton(
+ onPressed: _navigateToPreviousGreeting,
+ icon: const Icon(Icons.arrow_back),
+ ),
+ const SizedBox(width: 20),
+ ElevatedButton(
+ onPressed: () {
+ readName(greeting.name);
+ },
+ style: ElevatedButton.styleFrom(
+ foregroundColor: Colors.white, backgroundColor: Colors.grey, // Text color
+ padding: EdgeInsets.symmetric(horizontal: 30, vertical: 15),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(30),
+ ),
+ elevation: 5,
+ ),
+ child: const Text(
+ 'Pronounce',
+ style: TextStyle(
+ fontSize: 18,
+ fontWeight: FontWeight.bold,
+ ),
+ ),
+ ),
+ const SizedBox(width: 20),
+ IconButton(
+ onPressed: _navigateToNextGreeting,
+ icon: const Icon(Icons.arrow_forward),
+ ),
+ ],
+ ),
+ ],
+ ),
+ );
+ }
+
+ Future _playGreetingSound(String soundAsset) async {
+ await widget.audioPlayer.setAsset(soundAsset);
+ await widget.audioPlayer.play();
+ }
+
+ Future readName(String name) async {
+ await widget.flutterTts.setLanguage("EN-IN");
+ await widget.flutterTts.speak(name);
+ }
+}
diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart
index 253e5bf..3820f4c 100644
--- a/lib/utils/constants.dart
+++ b/lib/utils/constants.dart
@@ -858,6 +858,7 @@ class AppConstants {
static const String solar = 'Solar System';
static const String flowers = 'Flowers';
static const String fruit = 'Fruits & Vegetables';
+ static const String greeting = 'Greetings';
static const String description =
- 'Interactive app to let your kids learn various things like\n\n - A - Z alphabets.\n - Animals and their sounds.\n - Birds and their sounds.\n - Various shapes.\n - Body parts.\n - Solar system.\n';
+ 'Interactive app to let your kids learn various things like\n\n - A - Z alphabets.\n - Animals and their sounds.\n - Birds and their sounds.\n - Various shapes.\n - Body parts.\n - Solar system.\n - ';
}
diff --git a/lib/utils/routes.dart b/lib/utils/routes.dart
index c64b442..41d3e33 100644
--- a/lib/utils/routes.dart
+++ b/lib/utils/routes.dart
@@ -16,4 +16,5 @@ class AllRoutes {
static const String seasonRoute = "/seasons";
static const String occupationRoute = '/occupations';
static const String fruitRoute = "/fruit";
+ static const String greetingsRoute='/greetings';
}
diff --git a/pubspec.yaml b/pubspec.yaml
index a284a1a..f9f8c22 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -45,7 +45,6 @@ dependencies:
fluttertoast: ^8.2.5
google_nav_bar: ^5.0.6
flutter_bloc: ^8.1.5
- animated_text_kit: ^4.2.2
dev_dependencies:
flutter_test:
@@ -71,21 +70,18 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- - assets/images/
- - assets/sounds/animals/
- - assets/sounds/birds/
- assets/images/alphabet/
- - assets/images/animal/
+ - assets/sounds/
- assets/images/body/
- assets/images/birds/
- - assets/images/solar/
- assets/colours/
- assets/images/flowers/
- assets/explore/
- assets/seasons/
- - assets/occupations/
-
- assets/fruitsVeges/
+ - assets/Greetings/
+ - assets/images/animal/
+
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware