BreakPoint.of constructor

BreakPoint.of(
  1. BuildContext context
)

Use this to identification current state and get all the properties present on the breakpoint

Implementation

factory BreakPoint.of(BuildContext context) {
  final double screenWidth = MediaQuery.of(context).size.width;

  if (screenWidth >= _widthXxl) {
    return BreakPoint(
      breakpoint: _widthXxl,
      containerWidth: _containerXxl,
      screenWidth: screenWidth,
      state: stateXxl,
    );
  } else if (screenWidth >= _widthXl) {
    return BreakPoint(
      breakpoint: _widthXl,
      containerWidth: _containerXl,
      screenWidth: screenWidth,
      state: stateXl,
    );
  } else if (screenWidth >= _widthLg) {
    return BreakPoint(
      breakpoint: _widthLg,
      containerWidth: _containerLg,
      screenWidth: screenWidth,
      state: stateLg,
    );
  } else if (screenWidth >= _widthMd) {
    return BreakPoint(
      breakpoint: _widthMd,
      containerWidth: _containerMd,
      screenWidth: screenWidth,
      state: stateMd,
    );
  } else if (screenWidth >= _widthSm) {
    return BreakPoint(
      breakpoint: _widthSm,
      containerWidth: _containerSm,
      screenWidth: screenWidth,
      state: stateSm,
    );
  }

  return BreakPoint(
    breakpoint: 0.0,
    containerWidth: screenWidth,
    screenWidth: screenWidth,
    state: stateXs,
  );
}