Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto dev
  • Loading branch information
Fabi-02 committed Apr 17, 2024
2 parents 6fb7d64 + 1eae0cc commit a97bcb0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions frontend/lib/components/dashboard_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class DashboardCard extends StatefulWidget {
State<DashboardCard> createState() => _DashboardCardState();
}

class _DashboardCardState extends State<DashboardCard>
with SingleTickerProviderStateMixin {
class _DashboardCardState extends State<DashboardCard> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;

Expand All @@ -31,15 +30,13 @@ class _DashboardCardState extends State<DashboardCard>
duration: const Duration(milliseconds: 400),
vsync: this,
);

_animation = CurvedAnimation(
parent: _controller,
curve: Curves.easeOut,
);

_controller.forward();
}

void _displayDisabledDialog() {
showDialog(
context: context,
Expand All @@ -60,6 +57,10 @@ class _DashboardCardState extends State<DashboardCard>

@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(
Expand All @@ -74,8 +75,8 @@ class _DashboardCardState extends State<DashboardCard>
children: [
SvgPicture.asset(
widget.svgImage,
height: 110,
width: 110,
height: imageSize,
width: imageSize,
colorFilter: widget.enabled
? null
: ColorFilter.mode(Colors.grey[300]!, BlendMode.saturation),
Expand Down

0 comments on commit a97bcb0

Please sign in to comment.