24 lines
554 B
Dart
24 lines
554 B
Dart
|
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,
|
||
|
);
|
||
|
}
|
||
|
}
|