useState function

  1. @Deprecated('Use KaeruWidget instead. This will be removed in a future version.')
DefineWidgetBuilderState useState()

Returns the DefineWidgetBuilderState of the current widget.

Note: This is part of the deprecated defineWidget API.

Implementation

@Deprecated('Use KaeruWidget instead. This will be removed in a future version.')
DefineWidgetBuilderState useState() {
  final ctx = getCurrentState();
  if (ctx == null) throw Exception('Current context is null');
  return ctx;
}