useQueryClient function

QoraClient useQueryClient()

Returns the nearest QoraClient from the widget tree.

Reads QoraScope.of via flutter_hooks' useContext. Throws a FlutterError if no QoraScope ancestor is found in the tree.

Must be called inside a HookWidget.build method.

class MyWidget extends HookWidget {
  @override
  Widget build(BuildContext context) {
    final client = useQueryClient();
    // ...
  }
}

Implementation

QoraClient useQueryClient() {
  final context = useContext();
  return QoraScope.of(context);
}