import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; class ShowUp extends HookWidget { const ShowUp({ super.key, required this.child, this.duration, }); final Widget child; final Duration? duration; @override Widget build(BuildContext context) { final controller = useAnimationController(duration: const Duration(milliseconds: 300)); useMemoized(() async { if (duration != null) { await Future.delayed(duration!); } controller.forward(); }); return FadeTransition( opacity: CurvedAnimation(curve: Curves.easeIn, parent: controller), child: child, ); } }