fromResponsiveWrapper method Null safety

ResponsiveWrapperData fromResponsiveWrapper(
  1. _ResponsiveWrapperState state
)

Creates data based on the ResponsiveWrapper state.

Implementation

static ResponsiveWrapperData fromResponsiveWrapper(
    _ResponsiveWrapperState state) {
  return ResponsiveWrapperData(
    screenWidth: state.screenWidth,
    screenHeight: state.screenHeight,
    scaledWidth: state.scaledWidth,
    scaledHeight: state.scaledHeight,
    breakpoints: state.breakpoints,
    breakpointSegments: state.breakpointSegments,
    activeBreakpoint: state.activeBreakpointSegment.responsiveBreakpoint,
    isMobile:
        state.activeBreakpointSegment.responsiveBreakpoint.name == MOBILE,
    isPhone: state.activeBreakpointSegment.responsiveBreakpoint.name == PHONE,
    isTablet:
        state.activeBreakpointSegment.responsiveBreakpoint.name == TABLET,
    isDesktop:
        state.activeBreakpointSegment.responsiveBreakpoint.name == DESKTOP,
    orientation: state.orientation,
  );
}