Flutter utility hook that returns a function that forces component to re-build when called.
dependencies:
flutter_use: ^0.0.2
class Sample extends HookWidget {
@override
Widget build(BuildContext context) {
final update = useUpdate();
return Column(
children: [
Text("Now: ${DateTime.now()}"),
ElevatedButton(
onPressed: () => update(),
child: const Text("Update"),
),
]
);
}
}