get_hooks
Get Hooks is a simple package that adds a widget definition for a version of the GetView
widget but with the capabilities of a HookWidget
.
class AnimatedHookWidget extends GetHookView<HomeController> {
const AnimatedHookWidget({super.key});
@override
Widget build(BuildContext context) {
final animationController = useAnimationController(
duration: const Duration(seconds: 5),
);
final animation = useAnimation(animationController);
animationController.repeat(min: 0, max: 1);
return Transform.rotate(
angle: pi * animation * 2,
child: const FlutterLogo(
size: 100,
),
);
}
}