responsiveVisibility function
bool
responsiveVisibility({
- required BuildContext context,
- bool phone = true,
- bool tablet = true,
- bool tabletLandscape = true,
- bool desktop = true,
Implementation
bool responsiveVisibility({
required BuildContext context,
bool phone = true,
bool tablet = true,
bool tabletLandscape = true,
bool desktop = true,
}) {
final width = MediaQuery.of(context).size.width;
if (width < kBreakpointSmall) {
return phone;
} else if (width < kBreakpointMedium) {
return tablet;
} else if (width < kBreakpointLarge) {
return tabletLandscape;
} else {
return desktop;
}
}