breakpoint property

FlexiBreakpoint get breakpoint

The current semantic breakpoint (e.g., phone, tablet, desktop).

Triggers a rebuild ONLY when the breakpoint changes.

Implementation

FlexiBreakpoint get breakpoint {
  // Explicitly listen to 'breakpoint' aspect
  final data = FlexiInheritedWidget.of(_context, aspect: FlexiAspect.breakpoint);
  if (data == null) {
    // Fallback or throw? Ideally this shouldn't happen if FlexiConfig is present.
    // If null, we can't really do much. Return a default or throw helpful error.
    throw FlutterError(
        'FlexiConfig not found in context. Make sure to wrap your app with FlexiConfig.');
  }
  return data.breakpoint;
}