ResponsiveElements.of constructor

ResponsiveElements.of(
  1. BuildContext context
)

Implementation

factory ResponsiveElements.of(BuildContext context) {
  final data = MediaQuery.of(context);
  final size = data.size;
  final inch = math.sqrt(math.pow(size.width, 2) + math.pow(size.height, 2));
  final orientation = MediaQuery.of(context).orientation;
  return ResponsiveElements(
      width: size.width,
      height: size.height,
      orientation: orientation,
      inch: inch);
}