context property

BuildContext get context

Returns the current BuildContext.

Throws a descriptive StateError if accessed before a BuildContext is attached.

Implementation

BuildContext get context {
  final ctx = _context;
  if (ctx == null) {
    throw StateError(
      'ResponsiveScreen context has not been initialized. '
      'Ensure the widget has been built before accessing context-dependent screen properties.',
    );
  }
  return ctx;
}
set context (BuildContext value)

Implementation

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