We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9aaeae3 commit ee1c1afCopy full SHA for ee1c1af
lib/animation/FadeAnimation.dart
@@ -0,0 +1,33 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:simple_animations/simple_animations.dart';
3
+
4
+class FadeAnimation extends StatelessWidget {
5
+ final double delay;
6
+ final Widget child;
7
8
+ FadeAnimation(this.delay, this.child);
9
10
+ @override
11
+ Widget build(BuildContext context) {
12
+ final tween = MultiTrackTween([
13
+ Track("opacity").add(Duration(milliseconds: 500), Tween(begin: 0.0, end: 1.0)),
14
+ Track("translateY").add(
15
+ Duration(milliseconds: 500), Tween(begin: -30.0, end: 0.0),
16
+ curve: Curves.easeOut)
17
+ ]);
18
19
+ return ControlledAnimation(
20
+ delay: Duration(milliseconds: (500 * delay).round()),
21
+ duration: tween.duration,
22
+ tween: tween,
23
+ child: child,
24
+ builderWithChild: (context, child, animation) => Opacity(
25
+ opacity: (animation as Map)["opacity"],
26
+ child: Transform.translate(
27
+ offset: Offset(0, (animation as Map)["translateY"]),
28
+ child: child
29
+ ),
30
31
+ );
32
+ }
33
+}
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments