fix layout of MIH App Tile Widget

This commit is contained in:
2025-03-25 16:03:47 +02:00
parent d6fb8e8d64
commit f315eceacf

View File

@@ -52,55 +52,69 @@ class _MihAppTileState extends State<MihAppTile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double borderRadius = widget.iconSize * 0.25; double borderRadius = widget.iconSize * 0.15;
return SizedBox( return SizedBox(
width: widget.iconSize, width: widget.iconSize,
height: widget.iconSize,
child: Container( child: Container(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
// color: Colors.black,
// constraints: BoxConstraints(),
child: Column( child: Column(
children: [ children: [
AnimatedContainer( Flexible(
//alignment: Alignment.center, flex: 3,
width: widget.iconSize, child: LayoutBuilder(
height: widget.iconSize, builder: (context, constraints) {
duration: const Duration(seconds: 2), double iconHeight = constraints.maxWidth;
child: Material( return AnimatedContainer(
color: widget.primaryColor, height: iconHeight,
// shadowColor: duration: const Duration(seconds: 2),
// MzanziInnovationHub.of(context)!.theme.secondaryColor(), child: Material(
// elevation: 5, color: widget.primaryColor,
borderRadius: BorderRadius.circular(borderRadius), // shadowColor:
child: InkWell( // MzanziInnovationHub.of(context)!.theme.secondaryColor(),
borderRadius: BorderRadius.circular(borderRadius), // elevation: 5,
// ho borderRadius: BorderRadius.circular(borderRadius),
onTap: widget.onTap, child: InkWell(
onLongPress: () { borderRadius: BorderRadius.circular(borderRadius),
displayHint(); // ho
}, onTap: widget.onTap,
// hoverDuration: , onLongPress: () {
splashColor: displayHint();
MzanziInnovationHub.of(context)!.theme.highlightColor(), },
highlightColor: // hoverDuration: ,
MzanziInnovationHub.of(context)!.theme.highlightColor(), splashColor: MzanziInnovationHub.of(context)!
child: FittedBox(child: widget.appIcon), .theme
), .highlightColor(),
highlightColor: MzanziInnovationHub.of(context)!
.theme
.highlightColor(),
child: FittedBox(child: widget.appIcon),
),
),
);
},
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
FittedBox( Flexible(
child: Text( flex: 1,
widget.appName, child: Row(
textAlign: TextAlign.center, mainAxisAlignment: MainAxisAlignment.center,
// softWrap: true, children: [
// overflow: TextOverflow.visible, Text(
style: TextStyle( widget.appName,
color: textAlign: TextAlign.center,
MzanziInnovationHub.of(context)!.theme.secondaryColor(), // softWrap: true,
fontSize: 40.0, // overflow: TextOverflow.visible,
fontWeight: FontWeight.bold, style: TextStyle(
), color: MzanziInnovationHub.of(context)!
.theme
.secondaryColor(),
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
],
), ),
) )
], ],