getBreakpointEntry function

BreakpointSystemEntry getBreakpointEntry(
  1. BuildContext context
)

Returns the BreakpointSystemEntry to the user.

Typically the developer will use the getWindowType function. Using this function gives the developer access to the specific breakpoint entry and it's variables.

Implementation

BreakpointSystemEntry getBreakpointEntry(BuildContext context) {
  double width = MediaQuery.sizeOf(context).width;
  for (BreakpointSystemEntry entry in breakpointSystem) {
    if (entry.range.start <= width && width < entry.range.end + 1) {
      return entry;
    }
  }
  throw AssertionError('Something unexpected happened');
}