diff --git a/frontend/lib/components/dashboard_card.dart b/frontend/lib/components/dashboard_card.dart index a34fcb7..abad19d 100644 --- a/frontend/lib/components/dashboard_card.dart +++ b/frontend/lib/components/dashboard_card.dart @@ -19,8 +19,7 @@ class DashboardCard extends StatefulWidget { State createState() => _DashboardCardState(); } -class _DashboardCardState extends State - with SingleTickerProviderStateMixin { +class _DashboardCardState extends State with SingleTickerProviderStateMixin { late AnimationController _controller; late Animation _animation; @@ -31,15 +30,13 @@ class _DashboardCardState extends State duration: const Duration(milliseconds: 400), vsync: this, ); - _animation = CurvedAnimation( parent: _controller, curve: Curves.easeOut, ); - _controller.forward(); } - + void _displayDisabledDialog() { showDialog( context: context, @@ -60,6 +57,10 @@ class _DashboardCardState extends State @override Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double imageSize = screenWidth * 0.25; // 25% der Bildschirmbreite + imageSize = imageSize.clamp(80.0, 150.0); // Begrenzung der Größe zwischen 80 und 150 Pixeln + return GestureDetector( onTap: widget.enabled ? widget.onTap : _displayDisabledDialog, child: ScaleTransition( @@ -74,8 +75,8 @@ class _DashboardCardState extends State children: [ SvgPicture.asset( widget.svgImage, - height: 110, - width: 110, + height: imageSize, + width: imageSize, colorFilter: widget.enabled ? null : ColorFilter.mode(Colors.grey[300]!, BlendMode.saturation),