unmount method

  1. @override
void unmount()
override

Called when the hook is being removed.

This happens when:

  • The widget is being disposed
  • During hot reload when there's a type mismatch

Use this to clean up resources, cancel subscriptions, etc.

Implementation

@override
void unmount() {
  state.dispose();
}