Skip to content

Commit

Permalink
(A-Zpage) overflow-fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
prajapatihet committed May 29, 2024
1 parent ee1acab commit 7b03e50
Showing 1 changed file with 81 additions and 83 deletions.
164 changes: 81 additions & 83 deletions lib/pages/modules/atoz.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'dart:async';
Expand Down Expand Up @@ -38,7 +37,7 @@ class ItemTile extends StatelessWidget {
);
},
child: Padding(
padding: const EdgeInsets.all(6),
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 5),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
Expand All @@ -51,27 +50,25 @@ class ItemTile extends StatelessWidget {
),
textAlign: TextAlign.center,
),
const SizedBox(height: 3),
LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints){
if (MediaQuery.of(context).orientation ==
Orientation.portrait) {
return SvgPicture.asset(
item.iconAsset,
width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.width * 0.3,
alignment: Alignment.center,
);
} else {
return SvgPicture.asset(
item.iconAsset,
width: MediaQuery.of(context).size.width * 0.3,
height: MediaQuery.of(context).size.width * 0.2,
alignment: Alignment.center,
);
}
builder: (BuildContext context, BoxConstraints constraints) {
if (MediaQuery.of(context).orientation ==
Orientation.portrait) {
return SvgPicture.asset(
item.iconAsset,
width: MediaQuery.of(context).size.width * 0.2,
height: MediaQuery.of(context).size.height * 0.1,
alignment: Alignment.center,
);
} else {
return SvgPicture.asset(
item.iconAsset,
width: MediaQuery.of(context).size.width * 0.2,
height: MediaQuery.of(context).size.height * 0.2,
alignment: Alignment.center,
);
}
),
}),
const SizedBox(height: ConstantDimensions.heightExtraSmall / 2),
Text(item.description, textAlign: TextAlign.center),
],
Expand Down Expand Up @@ -163,80 +160,81 @@ class _PopupDialogState extends State<_PopupDialog> {
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
content: Container(
padding: EdgeInsets.zero,
width: MediaQuery.of(context).size.width * 0.7,
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(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Text(
currentItem.title,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 40,
padding: const EdgeInsets.all(18),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
Text(
currentItem.title,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 40,
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
const SizedBox(height: ConstantDimensions.heightMedium),
GestureDetector(
onTap: () {
_speakText(currentItem.description);
},
child: SvgPicture.asset(
currentItem.iconAsset,
width: MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.width * 0.5,
alignment: Alignment.center,
const SizedBox(height: ConstantDimensions.heightMedium),
GestureDetector(
onTap: () {
_speakText(currentItem.description);
},
child: SvgPicture.asset(
currentItem.iconAsset,
width: MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.height * 0.3,
alignment: Alignment.center,
),
),
),
const SizedBox(height: ConstantDimensions.heightMedium),
Text(
currentItem.description,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 28,

),
),
const SizedBox(height: ConstantDimensions.heightMedium),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ElevatedButton(
onPressed: _previousItem,
child: const Text('Prev'),
const SizedBox(height: ConstantDimensions.heightMedium),
Text(
currentItem.description,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 28,
),
),
ElevatedButton(
onPressed: _nextItem,
child: const Text('Next'),
const SizedBox(height: ConstantDimensions.heightMedium),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
ElevatedButton(
onPressed: _previousItem,
child: const Text('Prev'),
),
ElevatedButton(
onPressed: _nextItem,
child: const Text('Next'),
),
],
),
],
),
const SizedBox(height: ConstantDimensions.heightMedium),
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
const Color.fromARGB(216, 233, 101, 92),
const SizedBox(height: ConstantDimensions.heightMedium),
ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(
const Color.fromARGB(216, 233, 101, 92),
),
),
onPressed: () {
Navigator.pop(context);
},
child: const Text(
'Close',
style: TextStyle(color: Colors.white),
),
),
),
onPressed: () {
Navigator.pop(context);
},
child: const Text(
'Close',
style: TextStyle(color: Colors.white),
),
],
),
const SizedBox(height: ConstantDimensions.heightExtraLarge),
],
),
),
),
),
)
);
}
}
Expand Down Expand Up @@ -293,7 +291,7 @@ class _AtoZState extends State<AtoZ> {
child: GridView.count(
crossAxisCount: MediaQuery.of(context).size.width ~/
200, // Adjust the value based on screen width
childAspectRatio: 1.0, // Aspect ratio of items
childAspectRatio: 0.8, // Aspect ratio of items
children: List.generate(
items.length,
(index) => ItemTile(
Expand Down

0 comments on commit 7b03e50

Please sign in to comment.