responsiveFunction method
dynamic
responsiveFunction({})
Use to return different function depending on screen type.
Implementation
responsiveFunction(
{required Function forUnInitialDevices,
Function? forPortraitMobileScreen,
Function? forLandscapeMobileScreen,
Function? forPortraitTabletScreen,
Function? forLandscapeTabletScreen,
Function? forDesktopScreen,
Function? forTVScreen}) {
if (_responsiveHandler._screenType == ScreenType.phone)
return (_responsiveHandler._deviceInfo.orientation == Orientation.portrait
? forPortraitMobileScreen
: forLandscapeMobileScreen) ??
forUnInitialDevices;
else if (_responsiveHandler._screenType == ScreenType.tabletOrIpad)
return (_responsiveHandler._deviceInfo.orientation == Orientation.portrait
? forPortraitTabletScreen
: forLandscapeTabletScreen) ??
forUnInitialDevices;
else if (_responsiveHandler._screenType == ScreenType.desktop ||
_responsiveHandler._screenType == ScreenType.website)
return forDesktopScreen ?? forUnInitialDevices;
else
return forTVScreen ?? forUnInitialDevices;
}