forked from yaso_meth/mih-project
Updat homeTile to cater for images
This commit is contained in:
@@ -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<HomeTile> {
|
||||
|
||||
@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,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user