AdvancedBreakpoints extension
Advanced Breakpoints Extension for ResponsiveMedia
This file provides advanced breakpoint functionality including:
- Device type detection (isMobile, isTablet, isDesktop)
- Custom breakpoint support
- Breakpoint comparison methods Extension on ResponsiveMedia to add advanced breakpoint functionality
Properties
- currentBreakpoint → String
-
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Returns the name of the current active custom breakpoint Returns the largest breakpoint name that the screen width satisfies Returns 'unknown' if no custom breakpoints are defined or matchedno setter - isDesktop → bool
-
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Determines if the current device is a desktop Based on screen width being greater than or equal to the tablet breakpoint thresholdno setter - isMobile → bool
-
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Determines if the current device is a mobile device Based on screen width being less than the mobile breakpoint thresholdno setter - isTablet → bool
-
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Determines if the current device is a tablet Based on screen width being between mobile and tablet breakpoint thresholdsno setter
Methods
-
between(
String startBreakpoint, String endBreakpoint) → bool -
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
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 -
isBreakpoint(
String breakpointName) → bool -
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Checks if the current screen width matches a custom breakpoint Returns true if the screen width is greater than or equal to the specified breakpoint Returns false if the breakpoint name is not found in customBreakpoints -
largerThan(
String breakpointName) → bool -
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Checks if the current screen width is larger than a custom breakpoint Returns true if the screen width is strictly greater than the specified breakpoint Returns false if the breakpoint name is not found in customBreakpoints -
smallerThan(
String breakpointName) → bool -
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Checks if the current screen width is smaller than a custom breakpoint Returns true if the screen width is strictly less than the specified breakpoint Returns false if the breakpoint name is not found in customBreakpoints -
valueByBreakpoint<
T> ({required Map< String, T> breakpointValues, required T defaultValue}) → T -
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Returns a value based on custom breakpoint Returns the value associated with the current active breakpoint Returns defaultValue if no matching breakpoint is found -
valueByDevice<
T> ({required T mobile, required T tablet, required T desktop}) → T -
Available on ResponsiveMedia, provided by the AdvancedBreakpoints extension
Returns a value based on device type Useful for returning different values for mobile, tablet, and desktop
Constants
- defaultMobileBreakpoint → const double
- Default breakpoint thresholds
- defaultTabletBreakpoint → const double
- Default breakpoint thresholds