Skip to content

Commit

Permalink
converted all the images to svg and then added
Browse files Browse the repository at this point in the history
  • Loading branch information
LEARNER-dakshesh committed May 28, 2024
1 parent 3a20824 commit 20103f0
Show file tree
Hide file tree
Showing 11 changed files with 4,724 additions and 15 deletions.
872 changes: 872 additions & 0 deletions assets/Greetings/all_the_best.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Greetings/best of luck.mp3
Binary file not shown.
131 changes: 131 additions & 0 deletions assets/Greetings/congrats.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions assets/Greetings/hi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Greetings/please.mp3
Binary file not shown.
94 changes: 94 additions & 0 deletions assets/Greetings/please.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Greetings/say cheeze.mp3
Binary file not shown.
1,020 changes: 1,020 additions & 0 deletions assets/Greetings/say_cheese.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Greetings/sorry.mp3
Binary file not shown.
2,458 changes: 2,458 additions & 0 deletions assets/Greetings/sorry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions lib/pages/modules/greetings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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';

Expand All @@ -20,40 +21,40 @@ class Greetings {

class AppConstants {
static const String greetings = 'Greetings';
static final List<Greetings> greetingList= [
static final List<Greetings> greetingList = [
Greetings(
name: 'Hello',
imgAsset: 'assets/Greetings/hi.jpg',
imgAsset: 'assets/Greetings/hi.svg',
soundAsset: 'assets/sounds/hi.mp3',
backgroundColor: Colors.indigoAccent,
backgroundColor: Colors.white,
),
Greetings(
name: 'Say Cheese',
imgAsset: 'assets/Greetings/say_cheeze.jpg',
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.jpg',
imgAsset: 'assets/Greetings/all_the_best.svg',
soundAsset: 'assets/sounds/good_night.mp3',
backgroundColor: Colors.blue,
),
Greetings(
name: 'Sorry',
imgAsset: 'assets/Greetings/sorry.jpg',
imgAsset: 'assets/Greetings/sorry.svg',
soundAsset: 'assets/sounds/good_night.mp3',
backgroundColor: Colors.orange,
),
Greetings(
name: 'Please',
imgAsset: 'assets/Greetings/please.jpg',
imgAsset: 'assets/Greetings/please.svg',
soundAsset: 'assets/sounds/good_night.mp3',
backgroundColor: Colors.blue,
),
Greetings(
name: 'Congratulations',
imgAsset: 'assets/Greetings/congrats.jpg',
imgAsset: 'assets/Greetings/congrats.svg',
soundAsset: 'assets/sounds/good_night.mp3',
backgroundColor: Colors.red,
),
Expand Down Expand Up @@ -112,8 +113,7 @@ class _GreetingsWidgetState extends State<GreetingsWidget> {

void _navigateToPreviousGreeting() {
setState(() {
currentIndex =
(currentIndex - 1 + widget.greetings.length) % widget.greetings.length;
currentIndex = (currentIndex - 1 + widget.greetings.length) % widget.greetings.length;
});
}

Expand All @@ -140,14 +140,15 @@ class _GreetingsWidgetState extends State<GreetingsWidget> {
SizedBox(
width: 350,
height: 350,
child: Image.asset(greeting.imgAsset),
child: greeting.imgAsset.endsWith('.svg')
? SvgPicture.asset(greeting.imgAsset)
: Image.asset(greeting.imgAsset),
),
],
),
),
),
const SizedBox(height: 20),

Text(
greeting.name,
style: const TextStyle(
Expand Down Expand Up @@ -185,11 +186,10 @@ class _GreetingsWidgetState extends State<GreetingsWidget> {
),
),
),

const SizedBox(width: 20),
IconButton(
onPressed: _navigateToNextGreeting,
icon:const Icon(Icons.arrow_forward),
icon: const Icon(Icons.arrow_forward),
),
],
),
Expand All @@ -207,4 +207,4 @@ class _GreetingsWidgetState extends State<GreetingsWidget> {
await widget.flutterTts.setLanguage("EN-IN");
await widget.flutterTts.speak(name);
}
}
}

0 comments on commit 20103f0

Please sign in to comment.