final ctrl = useScrollController(); @override Widget build(BuildContext context, WidgetRef ref) { // final ctrl = ref.watch(_scrollController);
======== Exception caught by widgets library ======================================================= The following assertion was thrown building Builder(dirty): Hooks can only be called from the build method of a widget that mix-in `Hooks`. Hooks should only be called within the build method of a widget. Calling them outside of build method leads to an unstable state and is therefore prohibited. 'package:flutter_hooks/src/framework.dart': Failed assertion: line 133 pos 12: 'HookElement._currentHookElement != null'