From e65e54b597371778063bdd23715914e68609f940 Mon Sep 17 00:00:00 2001 From: yaso-meth Date: Wed, 28 Aug 2024 13:41:44 +0200 Subject: [PATCH] Updat homeTile to cater for images --- .../lib/components/homeTile.dart | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/Frontend/patient_manager/lib/components/homeTile.dart b/Frontend/patient_manager/lib/components/homeTile.dart index c1bc0ddc..c07aa741 100644 --- a/Frontend/patient_manager/lib/components/homeTile.dart +++ b/Frontend/patient_manager/lib/components/homeTile.dart @@ -4,7 +4,7 @@ import 'package:patient_manager/main.dart'; class HomeTile extends StatefulWidget { final String tileName; //final String tileDescription; - final IconData tileIcon; + final Widget tileIcon; final void Function() onTap; // final Widget tileIcon; final Color p; @@ -100,41 +100,39 @@ class _HomeTileState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.all(10.0), - child: FittedBox( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Material( - color: mainC, - borderRadius: BorderRadius.circular(10), + // print( + // "Tile Name: ${widget.tileName}\nTitle Type: ${widget.tileIcon.runtimeType.toString()}"); + return FittedBox( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Material( + color: mainC, + borderRadius: BorderRadius.circular(80), + child: Ink( + padding: const EdgeInsets.all(20), child: InkWell( onTap: widget.onTap, - borderRadius: BorderRadius.circular(10), - //highlightColor: secondC, - child: Ink( - padding: const EdgeInsets.all(3.0), - child: Icon( - widget.tileIcon, - color: secondC, - ), + child: SizedBox( + height: 200, + width: 200, + child: widget.tileIcon, ), ), ), - const SizedBox(height: 1), - Text( - widget.tileName, - textAlign: TextAlign.center, - style: TextStyle( - color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), - fontSize: 5.0, - fontWeight: FontWeight.bold, - ), - ) - ], - ), + ), + const SizedBox(height: 10), + Text( + widget.tileName, + textAlign: TextAlign.center, + style: TextStyle( + color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), + fontSize: 40.0, + fontWeight: FontWeight.bold, + ), + ) + ], ), ); }