DeviceDescriptor.fromPixel constructor

DeviceDescriptor.fromPixel({
  1. required double height,
  2. required double width,
  3. required double pixelRatio,
  4. required EdgeInsets padding,
  5. EdgeInsets? paddingLandscape,
  6. required String name,
  7. double cornerRadius = 0.0,
  8. Size? notchSize,
  9. bool tablet = false,
  10. double navBarHeight = 48,
  11. required TargetPlatform platform,
})

Implementation

factory DeviceDescriptor.fromPixel({
  required double height,
  required double width,
  required double pixelRatio,
  required EdgeInsets padding,
  EdgeInsets? paddingLandscape,
  required String name,
  double cornerRadius = 0.0,
  Size? notchSize,
  bool tablet = false,
  double navBarHeight = 48,
  required TargetPlatform platform,
}) {
  return DeviceDescriptor(
    name: name,
    padding: padding,
    platform: platform,
    size: Size(width / pixelRatio, height / pixelRatio),
    cornerRadius: cornerRadius,
    navBarHeight: navBarHeight,
    notchSize: notchSize,
    paddingLandscape: paddingLandscape,
    tablet: tablet,
  );
}