between method
Checks if the current screen width is between two custom breakpoints Returns true if the screen width is within the range (inclusive of start, exclusive of end) Returns false if either breakpoint name is not found in customBreakpoints
Implementation
bool between(String startBreakpoint, String endBreakpoint) {
final customBreakpoints =
ResponsiveMediaBreakpointConfig.customBreakpoints;
if (!customBreakpoints.containsKey(startBreakpoint) ||
!customBreakpoints.containsKey(endBreakpoint)) {
return false;
}
return screenWidth >= customBreakpoints[startBreakpoint]! &&
screenWidth < customBreakpoints[endBreakpoint]!;
}