resolve method

T resolve(
  1. BuildContext context
)

Resolves the value based on the current BuildContext.

Priority: Desktop -> Tablet/Landscape -> Mobile.

Implementation

T resolve(BuildContext context) {
  final data =
      FlexiInheritedWidget.of(context, aspect: FlexiAspect.breakpoint);
  if (data == null) return mobile;

  final breakpoint = data.breakpoint;

  return switch (breakpoint) {
    FlexiBreakpoint.desktop => desktop ?? tablet ?? mobile,
    FlexiBreakpoint.tablet => tablet ?? mobile,
    FlexiBreakpoint.mobilePortrait || FlexiBreakpoint.mobileLandscape => mobile,
  };
}