getResponsiveSize method
Returns a responsive size based on the current screen type.
mobile is the size for mobile screens.
tablet is the optional size for tablet screens. If null, mobile is used.
desktop is the size for desktop screens.
Defaults to mobile if the screen type is not set.
Implementation
double getResponsiveSize({
required double mobile,
double? tablet,
required double desktop,
}) {
return switch (screenType) {
ScreenType.mobile => mobile,
ScreenType.tablet => tablet ?? mobile,
ScreenType.desktop => desktop,
null => mobile,
};
}