dreampad/lib/app/shared/widgets/show_up.dart

24 lines
554 B
Dart
Raw Normal View History

2023-11-30 12:34:48 +08:00
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
class ShowUp extends HookWidget {
const ShowUp({
super.key,
required this.child,
});
final Widget child;
@override
Widget build(BuildContext context) {
final controller =
useAnimationController(duration: const Duration(milliseconds: 300));
useMemoized(() {
controller.forward();
});
return FadeTransition(
opacity: CurvedAnimation(curve: Curves.easeIn, parent: controller),
child: child,
);
}
}