This commit is contained in:
Surendiran 2025-06-24 11:09:14 +05:30
commit 8785551174
2 changed files with 141 additions and 70 deletions

View File

@ -28,7 +28,7 @@ class ReportDetailPage extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade200, color: Colors.grey.shade100,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
), ),
child: Row( child: Row(
@ -60,20 +60,37 @@ class ReportDetailPage extends StatelessWidget {
const SizedBox(height: 24), const SizedBox(height: 24),
// Ranking section // Ranking section
Row( Container(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, decoration: BoxDecoration(
children: [ color: Colors.grey[100],
_RankingCard( borderRadius: BorderRadius.circular(12),
title: 'Rank in 2023', ),
value: '44', padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
icon: const Icon(Icons.arrow_downward, color: Colors.red, size: 25, weight: 50), child: Row(
), children: [
_RankingCard( Expanded(
title: 'vs. Previous Edition', child: _RankingCard(
value: '41', title: 'Rank in 2023',
icon: const SizedBox.shrink(), value: '44',
), icon: const Icon(Icons.arrow_downward, color: Colors.red, size: 25),
], ),
),
SizedBox(
height: 60,
width: 1,
child: CustomPaint(
painter: DottedLinePainter(),
),
),
Expanded(
child: _RankingCard(
title: 'vs. Previous Edition',
value: '41',
icon: const SizedBox.shrink(),
),
),
],
),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
@ -91,7 +108,10 @@ class ReportDetailPage extends StatelessWidget {
country: 'DENMARK', country: 'DENMARK',
flagPath: 'assets/country_flags/de.png', flagPath: 'assets/country_flags/de.png',
), ),
const Divider(), const Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: DottedDivider(),
),
_CountryRankingItem( _CountryRankingItem(
title: 'First in GCC', title: 'First in GCC',
country: 'MULTIPLE COUNTRIES', country: 'MULTIPLE COUNTRIES',
@ -122,7 +142,10 @@ class ReportDetailPage extends StatelessWidget {
), ),
), ),
), ),
const Divider(), const Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: DottedDivider(),
),
_CountryRankingItem( _CountryRankingItem(
title: 'First in Arab Countries', title: 'First in Arab Countries',
country: 'UNITED ARAB EMIRATES', country: 'UNITED ARAB EMIRATES',
@ -157,7 +180,6 @@ class _RankingCard extends StatelessWidget {
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[100], color: Colors.grey[100],
borderRadius: BorderRadius.circular(12),
), ),
child: Column( child: Column(
children: [ children: [
@ -271,3 +293,55 @@ class _CountryItem extends StatelessWidget {
); );
} }
} }
class DottedLinePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
const double dashHeight = 3, dashSpace = 2;
double startY = 0;
final paint = Paint()
..color = Colors.grey
..strokeWidth = 0.8;
while (startY < size.height) {
canvas.drawLine(Offset(0, startY), Offset(0, startY + dashHeight), paint);
startY += dashHeight + dashSpace;
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}
class HorizontalDottedLinePainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
const double dashWidth = 3, dashSpace = 2;
double startX = 0;
final paint = Paint()
..color = Colors.grey
..strokeWidth = 0.8;
while (startX < size.width) {
canvas.drawLine(Offset(startX, 0), Offset(startX + dashWidth, 0), paint);
startX += dashWidth + dashSpace;
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}
class DottedDivider extends StatelessWidget {
const DottedDivider({super.key});
@override
Widget build(BuildContext context) {
return CustomPaint(
painter: HorizontalDottedLinePainter(),
child: const SizedBox(
height: 1,
width: double.infinity,
),
);
}
}

View File

@ -164,59 +164,56 @@ class _LeaderCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return ClipRRect(
width: 170, borderRadius: BorderRadius.circular(8),
height: 100, child: Container(
decoration: BoxDecoration( width: 170,
color: Colors.white, height: 100,
borderRadius: BorderRadius.circular(12), decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
ClipRRect( children: [
borderRadius: const BorderRadius.only( ClipRRect(
topLeft: Radius.circular(12), borderRadius: BorderRadius.circular(12),
bottomLeft: Radius.circular(12), child: Image.asset(
), imagePath,
child: Image.asset( fit: BoxFit.cover,
imagePath,
height: double.infinity,
width: 80,
fit: BoxFit.cover,
),
),
const SizedBox(width: 8),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
position,
style: TextStyle(
fontSize: 10,
color: Colors.grey.shade600,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 4),
Text(
name,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
), ),
), ),
), const SizedBox(width: 8),
], Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
position,
style: TextStyle(
fontSize: 10,
color: Colors.grey.shade600,
),
// maxLines: 2,
overflow: TextOverflow.visible,
),
const SizedBox(height: 4),
Text(
name,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 12,
),
// maxLines: 2,
// overflow: TextOverflow.visible,
),
],
),
),
),
],
),
), ),
); );
} }