fromBreakpoint static method
Implementation
static DeviceScreen fromBreakpoint(
double deviceWidth,
ScreenBreakpoints breakpoints,
) {
if (breakpoints.isMinSBValue) {
if (deviceWidth >= breakpoints.desktop!.value) {
return DeviceScreen.desktop;
}
if (deviceWidth > breakpoints.tablet!.value) {
return DeviceScreen.tablet;
}
return DeviceScreen.mobile;
} else {
if (deviceWidth <= breakpoints.mobile!.value) {
return DeviceScreen.mobile;
}
if (deviceWidth <= breakpoints.tablet!.value) {
return DeviceScreen.tablet;
}
return DeviceScreen.desktop;
}
}