From 80a1af50db00a385fff88a9c802d9f1fbabdbbb3 Mon Sep 17 00:00:00 2001 From: Lenkomotive Date: Wed, 9 Oct 2024 22:54:28 +0200 Subject: [PATCH] PAINTROID-454: Flutter: Add Layers - hide after clicking on canvas --- lib/ui/shared/fade_in_out_widget.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/ui/shared/fade_in_out_widget.dart b/lib/ui/shared/fade_in_out_widget.dart index 574a266b..7f39c362 100644 --- a/lib/ui/shared/fade_in_out_widget.dart +++ b/lib/ui/shared/fade_in_out_widget.dart @@ -1,9 +1,5 @@ import 'package:flutter/material.dart'; -const Duration animationDuration = Duration(milliseconds: 300); -const double maxAnimationOpacity = 1.0; -const double minAnimationOpacity = 0.0; - class FadeInOutWidget extends StatelessWidget { final bool isVisible; final Widget child; @@ -19,8 +15,8 @@ class FadeInOutWidget extends StatelessWidget { return IgnorePointer( ignoring: !isVisible, child: AnimatedOpacity( - opacity: isVisible ? maxAnimationOpacity : minAnimationOpacity, - duration: animationDuration, + opacity: isVisible ? 1.0 : 0.0, + duration: const Duration(milliseconds: 300), child: child, ), );