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,19 +52,21 @@ 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) {
double iconHeight = constraints.maxWidth;
return AnimatedContainer(
height: iconHeight,
duration: const Duration(seconds: 2), duration: const Duration(seconds: 2),
child: Material( child: Material(
color: widget.primaryColor, color: widget.primaryColor,
@@ -80,28 +82,40 @@ class _MihAppTileState extends State<MihAppTile> {
displayHint(); displayHint();
}, },
// hoverDuration: , // hoverDuration: ,
splashColor: splashColor: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.highlightColor(), .theme
highlightColor: .highlightColor(),
MzanziInnovationHub.of(context)!.theme.highlightColor(), highlightColor: MzanziInnovationHub.of(context)!
.theme
.highlightColor(),
child: FittedBox(child: widget.appIcon), child: FittedBox(child: widget.appIcon),
), ),
), ),
);
},
),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
FittedBox( Flexible(
child: Text( flex: 1,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
widget.appName, widget.appName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
// softWrap: true, // softWrap: true,
// overflow: TextOverflow.visible, // overflow: TextOverflow.visible,
style: TextStyle( style: TextStyle(
color: color: MzanziInnovationHub.of(context)!
MzanziInnovationHub.of(context)!.theme.secondaryColor(), .theme
fontSize: 40.0, .secondaryColor(),
fontSize: 20.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
],
),
) )
], ],
), ),