import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:gascom/constants/app_theme.dart'; class HomeGridItem extends StatelessWidget { const HomeGridItem({ super.key, required this.title, required this.svgPath, required this.onPressed, }); final String title; final String svgPath; final void Function() onPressed; @override Widget build(BuildContext context) { return GestureDetector( onTap: onPressed, child: Column( // mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ AspectRatio( aspectRatio: 1, child: Container( padding: const EdgeInsets.all(25), decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.circular(11), border: Border.all( color: AppTheme.secondaryColor, width: 2, ), ), child: SvgPicture.asset( svgPath, semanticsLabel: title, ), ), ), // const SizedBox(height: 10,), AutoSizeText( title, style: Theme.of(context).textTheme.bodyMedium, minFontSize: 12, maxLines: 2, textAlign: TextAlign.center, ), ], ), ); } }