getActiveBreakpointSegment method

ResponsiveBreakpointSegment getActiveBreakpointSegment(
  1. double windowWidth
)

Set activeBreakpointSegment. Active breakpoint segment is the first breakpoint segment smaller or equal to the windowWidth.

Implementation

ResponsiveBreakpointSegment getActiveBreakpointSegment(double windowWidth) {
  ResponsiveBreakpointSegment activeBreakpointSegment = breakpointSegments
      .reversed
      .firstWhere((element) => windowWidth >= element.breakpoint);
  return activeBreakpointSegment;
}