Skip to content

Commit

Permalink
uifixed
Browse files Browse the repository at this point in the history
  • Loading branch information
prajapatihet committed Jun 2, 2024
1 parent 590dc7a commit 54215bd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions lib/pages/modules/animals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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),
Expand All @@ -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(
Expand All @@ -66,7 +65,8 @@ class AnimalsPage extends StatelessWidget {
);
}

Future<void> _showAnimalPopup(BuildContext context, Animal animal, int currentIndex) async {
Future<void> _showAnimalPopup(
BuildContext context, Animal animal, int currentIndex) async {
await flutterTts.setVolume(1.0);
await flutterTts.setSpeechRate(.5);
await flutterTts.setLanguage("EN-IN");
Expand Down Expand Up @@ -140,13 +140,11 @@ class _AnimalPopupState extends State<AnimalPopup> {
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),
Expand All @@ -157,12 +155,14 @@ class _AnimalPopupState extends State<AnimalPopup> {
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],
Expand All @@ -172,6 +172,7 @@ class _AnimalPopupState extends State<AnimalPopup> {
_navigateToNextAnimal();
},
icon: const Icon(Icons.arrow_forward),
iconSize: 30,
),
],
)
Expand All @@ -195,7 +196,7 @@ class _AnimalPopupState extends State<AnimalPopup> {
);
}

void _navigateToPreviousAnimal() {
void _navigateToPreviousAnimal() {
setState(() {
widget.currentIndex = (widget.currentIndex - 1) % widget.animals.length;
if (widget.currentIndex < 0) {
Expand All @@ -212,7 +213,6 @@ void _navigateToPreviousAnimal() {
});
}


Future<void> _playAnimalSound(String soundAsset) async {
await widget.audioPlayer.setAsset(soundAsset);
await widget.audioPlayer.play();
Expand Down
30 changes: 15 additions & 15 deletions lib/pages/modules/atoz.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 54215bd

Please sign in to comment.