DimenData.from constructor

DimenData.from(
  1. double dx,
  2. double dy
)

Implementation

factory DimenData.from(double dx, double dy) {
  final size = Size(dx, dy);
  final defaults = ConstraintDimenData(maxWidth: dx, maxHeight: dy);
  return DimenData(
    width: dx,
    height: dy,
    assumedSize: DimenInitializer.assumedSize(size),
    // CONSTRAINTS
    appbar: DimenInitializer.constraintOf(DefaultDimenKeys.appbar, size),
    bottom: DimenInitializer.constraintOf(DefaultDimenKeys.bottom, size),
    button: DimenInitializer.constraintOf(DefaultDimenKeys.button, size),
    image: DimenInitializer.constraintOf(
      DefaultDimenKeys.image,
      size,
      defaults: defaults,
    ),
    scaffold: DimenInitializer.constraintOf(
      DefaultDimenKeys.scaffold,
      size,
      defaults: defaults,
    ),
    // SIZES
    avatar: DimenInitializer.sizeOf(DefaultDimenKeys.avatar, size),
    corner: DimenInitializer.sizeOf(DefaultDimenKeys.corner, size),
    divider: DimenInitializer.sizeOf(DefaultDimenKeys.divider, size),
    fontSize: DimenInitializer.sizeOf(DefaultDimenKeys.fontSize, size),
    icon: DimenInitializer.sizeOf(DefaultDimenKeys.icon, size),
    indicator: DimenInitializer.sizeOf(DefaultDimenKeys.indicator, size),
    logo: DimenInitializer.sizeOf(DefaultDimenKeys.logo, size),
    margin: DimenInitializer.sizeOf(DefaultDimenKeys.margin, size),
    padding: DimenInitializer.sizeOf(DefaultDimenKeys.padding, size),
    space: DimenInitializer.sizeOf(DefaultDimenKeys.space, size),
    size: DimenInitializer.sizeOf(DefaultDimenKeys.size, size),
    stroke: DimenInitializer.sizeOf(DefaultDimenKeys.stroke, size),
    // WEIGHTS
    fontWeight: DimenInitializer.weightOf(DefaultDimenKeys.fontWeight, size),
  );
}