getState static method

ComponentViewState? getState(
  1. BuildContext context
)

Implementation

static ComponentViewState? getState(BuildContext context) {
  if (context is StatefulElement && context.state is ComponentViewState) {
    return (context.state as ComponentViewState);
  }
  return context.findAncestorStateOfType<ComponentViewState>();
}