import 'dart:io';

import 'package:design/design.dart';

part "editor_design_model.g.dart";

/// Created by Haoyi on 2022/8/19

@DesignSpec(width: 750, height: 1624)
abstract class EditorDesignSpec implements BasicDesignSpec {
  @NestedAspectSpec(654 / 500, 0.872, widthUpperLimit: 400)
  EditorDialogDesignSpec get dialogSpec;

  static EditorDesignSpec get() => _EditorDesignSpec.get();
}

@DesignSpec(width: 654, height: 500, nestedSpec: true)
abstract class EditorDialogDesignSpec implements BasicDesignSpec {
  @SpecRadius.circular(SpecHeight(40))
  BorderRadius get radius;

  @SpecHeight(8)
  double get bottomMargin;

  @SpecHeight(40)
  double get headerTopSpacing;

  @SpecEdgeInsets.symmetric(horizontal: SpecWidth(32))
  EdgeInsetsGeometry get headerPadding;

  @SpecHeight(85)
  double get headerHeight;

  @SpecHeight(48)
  double get closeIconSize;

  @SpecHeight(48)
  double get titleTopSpacing;

  @SpecAbsoluteFontSize(36)
  double get titleFontSize;

  @SpecVertical(28)
  double get textFieldFontSize;

  @SpecVertical(56)
  double get textFieldTopSpacing;

  @SpecHeight(104)
  double get textFieldHeight;

  @SpecRadius.circular(SpecHeight(24))
  BorderRadius get textFieldRadius;

  @SpecEdgeInsets.symmetric(horizontal: SpecHorizontal(40))
  EdgeInsets get textFieldHorizontalPadding;

  @SpecVertical(16)
  double get tipsTopSpacing;

  @SpecVertical(56)
  double get buttonVerticalSpacing;

  @SpecAspectHeightSize(96, 5.64583333)
  Size get buttonSize;

  @SpecAspectHeightSize(96, 2.52)
  Size get smallButtonSize;

  @SpecFontSize(32)
  double get buttonFontSize;

  @SpecOffset(SpecOrigin(0), SpecHeight(2))
  Offset get buttonShadowOffset;

  static EditorDialogDesignSpec create(Size measuredSize, {Offset offset = Offset.zero}) =>
      _EditorDialogDesignSpec._create(measuredSize);
}
