context property

BuildContext get context
inherited

The BuildContext of the nearest ControllerProvider ancestor.

This can be used to access inherited widgets and perform navigation. Throws an assertion error if accessed before the controller is initialized.

Implementation

BuildContext get context {
  assert(_context != null, 'Context accessed before initialization');
  return _context!;
}
  1. @protected
set context (BuildContext value)
inherited

Sets the BuildContext for this controller. This is called internally by ControllerProvider.

Implementation

@protected
set context(BuildContext value) => _context = value;