home tile press and hold color change

This commit is contained in:
2024-11-13 12:48:28 +02:00
parent a38ec882d9
commit abca9daf4c
3 changed files with 60 additions and 18 deletions

View File

@@ -106,30 +106,61 @@ class _MIHTileState extends State<MIHTile> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Material( AnimatedContainer(
width: 250,
height: 250,
duration: const Duration(seconds: 2),
child: Material(
color: mainC, color: mainC,
elevation: 10,
borderRadius: BorderRadius.circular(80), borderRadius: BorderRadius.circular(80),
child: Ink(
padding: const EdgeInsets.all(20),
child: InkWell( child: InkWell(
borderRadius: BorderRadius.circular(80),
// ho
onTap: widget.onTap, onTap: widget.onTap,
child: SizedBox( // hoverDuration: ,
height: 200, splashColor:
width: 200, MzanziInnovationHub.of(context)!.theme.highlightColor(),
highlightColor:
MzanziInnovationHub.of(context)!.theme.highlightColor(),
child: widget.tileIcon, child: widget.tileIcon,
), ),
), ),
), ),
), // Material(
// color: mainC,
// borderRadius: BorderRadius.circular(80),
// child: Ink(
// // width: 200,
// // height: 200,
// padding: const EdgeInsets.all(20),
// child: InkWell(
// onTap: widget.onTap,
// hoverDuration: Duration(seconds: 2),
// highlightColor:
// MzanziInnovationHub.of(context)!.theme.messageTextColor(),
// child: SizedBox(
// height: 200,
// width: 200,
// child: widget.tileIcon,
// ),
// ),
// ),
// ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( SizedBox(
width: 300,
child: Text(
widget.tileName, widget.tileName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
softWrap: true,
overflow: TextOverflow.visible,
style: TextStyle( style: TextStyle(
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(), color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
fontSize: 40.0, fontSize: 40.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
),
) )
], ],
), ),

View File

@@ -124,7 +124,10 @@ class _MIHHomeState extends State<MIHHome> {
); );
}, },
tileName: "Mzansi Profile", tileName: "Mzansi Profile",
tileIcon: Image(image: logo), tileIcon: Padding(
padding: const EdgeInsets.all(25.0),
child: Image(image: logo),
),
p: getPrim(), p: getPrim(),
s: getSec(), s: getSec(),
)); ));

View File

@@ -131,6 +131,14 @@ class MyTheme {
return Color(_errColor); return Color(_errColor);
} }
Color highlightColor() {
if (mode == "Dark") {
return const Color(0XFF9bc7fa);
} else {
return const Color(0XFF354866);
}
}
Color successColor() { Color successColor() {
return Color(_succColor); return Color(_succColor);
} }