helpBuilder<T> method
T
helpBuilder<T>({
- HelpBuilderCallback<
T> ? mobileSmall, - HelpBuilderCallback<
T> ? mobileSmallLandscape, - HelpBuilderCallback<
T> ? mobileNormal, - HelpBuilderCallback<
T> ? mobileNormalLandscape, - HelpBuilderCallback<
T> ? mobileLarge, - HelpBuilderCallback<
T> ? mobileLargeLandscape, - HelpBuilderCallback<
T> ? mobileExtraLarge, - HelpBuilderCallback<
T> ? mobileExtraLargeLandscape, - HelpBuilderCallback<
T> ? tabletSmall, - HelpBuilderCallback<
T> ? tabletSmallLandscape, - HelpBuilderCallback<
T> ? tabletNormal, - HelpBuilderCallback<
T> ? tabletNormalLandscape, - HelpBuilderCallback<
T> ? tabletLarge, - HelpBuilderCallback<
T> ? tabletLargeLandscape, - HelpBuilderCallback<
T> ? tabletExtraLarge, - HelpBuilderCallback<
T> ? tabletExtraLargeLandscape, - HelpBuilderCallback<
T> ? desktopSmall, - HelpBuilderCallback<
T> ? desktopSmallLandscape, - HelpBuilderCallback<
T> ? desktopNormal, - HelpBuilderCallback<
T> ? desktopNormalLandscape, - HelpBuilderCallback<
T> ? desktopLarge, - HelpBuilderCallback<
T> ? desktopLargeLandscape, - HelpBuilderCallback<
T> ? desktopExtraLarge, - HelpBuilderCallback<
T> ? desktopExtraLargeLandscape,
Takes T Function(double width, double height)
as a parameter
Implementation
T helpBuilder<T>({
HelpBuilderCallback<T>? mobileSmall,
HelpBuilderCallback<T>? mobileSmallLandscape,
HelpBuilderCallback<T>? mobileNormal,
HelpBuilderCallback<T>? mobileNormalLandscape,
HelpBuilderCallback<T>? mobileLarge,
HelpBuilderCallback<T>? mobileLargeLandscape,
HelpBuilderCallback<T>? mobileExtraLarge,
HelpBuilderCallback<T>? mobileExtraLargeLandscape,
HelpBuilderCallback<T>? tabletSmall,
HelpBuilderCallback<T>? tabletSmallLandscape,
HelpBuilderCallback<T>? tabletNormal,
HelpBuilderCallback<T>? tabletNormalLandscape,
HelpBuilderCallback<T>? tabletLarge,
HelpBuilderCallback<T>? tabletLargeLandscape,
HelpBuilderCallback<T>? tabletExtraLarge,
HelpBuilderCallback<T>? tabletExtraLargeLandscape,
HelpBuilderCallback<T>? desktopSmall,
HelpBuilderCallback<T>? desktopSmallLandscape,
HelpBuilderCallback<T>? desktopNormal,
HelpBuilderCallback<T>? desktopNormalLandscape,
HelpBuilderCallback<T>? desktopLarge,
HelpBuilderCallback<T>? desktopLargeLandscape,
HelpBuilderCallback<T>? desktopExtraLarge,
HelpBuilderCallback<T>? desktopExtraLargeLandscape,
}) {
final isPortrait = _orientation == Orientation.portrait;
if (_printScreenInfo) _printCurrentScreenInfo(_current, _size, isPortrait);
final portraitNodesList = [
if (mobileSmall != null) Node(BreakPoint.mobileSmall, mobileSmall),
if (mobileNormal != null) Node(BreakPoint.mobileNormal, mobileNormal),
if (mobileLarge != null) Node(BreakPoint.mobileLarge, mobileLarge),
if (mobileExtraLarge != null)
Node(BreakPoint.mobileExtraLarge, mobileExtraLarge),
if (tabletSmall != null) Node(BreakPoint.tabletSmall, tabletSmall),
if (tabletNormal != null) Node(BreakPoint.tabletNormal, tabletNormal),
if (tabletLarge != null) Node(BreakPoint.tabletLarge, tabletLarge),
if (tabletExtraLarge != null)
Node(BreakPoint.tabletExtraLarge, tabletExtraLarge),
if (desktopSmall != null) Node(BreakPoint.desktopSmall, desktopSmall),
if (desktopNormal != null) Node(BreakPoint.desktopNormal, desktopNormal),
if (desktopLarge != null) Node(BreakPoint.desktopLarge, desktopLarge),
if (desktopExtraLarge != null)
Node(BreakPoint.desktopExtraLarge, desktopExtraLarge),
];
final landscapeNodesList = [
if (mobileSmallLandscape != null)
Node(BreakPoint.mobileSmall, mobileSmallLandscape),
if (mobileNormalLandscape != null)
Node(BreakPoint.mobileNormal, mobileNormalLandscape),
if (mobileLargeLandscape != null)
Node(BreakPoint.mobileLarge, mobileLargeLandscape),
if (mobileExtraLargeLandscape != null)
Node(BreakPoint.mobileExtraLarge, mobileExtraLargeLandscape),
if (tabletSmallLandscape != null)
Node(BreakPoint.tabletSmall, tabletSmallLandscape),
if (tabletNormalLandscape != null)
Node(BreakPoint.tabletNormal, tabletNormalLandscape),
if (tabletLargeLandscape != null)
Node(BreakPoint.tabletLarge, tabletLargeLandscape),
if (tabletExtraLargeLandscape != null)
Node(BreakPoint.tabletExtraLarge, tabletExtraLargeLandscape),
if (desktopSmallLandscape != null)
Node(BreakPoint.desktopSmall, desktopSmallLandscape),
if (desktopNormalLandscape != null)
Node(BreakPoint.desktopNormal, desktopNormalLandscape),
if (desktopLargeLandscape != null)
Node(BreakPoint.desktopLarge, desktopLargeLandscape),
if (desktopExtraLargeLandscape != null)
Node(BreakPoint.desktopExtraLarge, desktopExtraLargeLandscape),
];
final closestNode = _findClosestNode(
_current,
isPortrait,
portraitNodesList,
landscapeNodesList,
);
if (closestNode != null)
return closestNode.value(_size.width, _size.height, _orientation);
else
throw Exception(
'Screen size not specified or there is no options passed from the parameters [current: `$_current`, orientation: `$_orientation`]');
}