Skip to content

Commit

Permalink
PAINTROID-454: Flutter: Add Layers - hide after clicking on canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
Lenkomotive committed Oct 9, 2024
1 parent 0f84aa8 commit 80a1af5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/ui/shared/fade_in_out_widget.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
),
);
Expand Down

0 comments on commit 80a1af5

Please sign in to comment.