DimenInitializer constructor

DimenInitializer({
  1. DeviceConfig? deviceConfig,
  2. DeviceType? deviceType,
  3. Iterable<DimenConfigData<Dimen>> dimens = const [],
  4. DimenConfig<ConstraintDimen> appbar = DefaultConfigs.appbar,
  5. DimenConfig<ConstraintDimen> bottom = DefaultConfigs.bottom,
  6. DimenConfig<ConstraintDimen> button = DefaultConfigs.button,
  7. DimenConfig<ConstraintDimen> image = DefaultConfigs.image,
  8. DimenConfig<ConstraintDimen> scaffold = DefaultConfigs.scaffold,
  9. DimenConfig<SizeDimen> avatar = DefaultConfigs.avatar,
  10. DimenConfig<SizeDimen> corner = DefaultConfigs.corner,
  11. DimenConfig<SizeDimen> divider = DefaultConfigs.divider,
  12. DimenConfig<SizeDimen> fontSize = DefaultConfigs.fontSize,
  13. DimenConfig<SizeDimen> icon = DefaultConfigs.icon,
  14. DimenConfig<SizeDimen> indicator = DefaultConfigs.indicator,
  15. DimenConfig<SizeDimen> margin = DefaultConfigs.margin,
  16. DimenConfig<SizeDimen> padding = DefaultConfigs.padding,
  17. DimenConfig<SizeDimen> size = DefaultConfigs.size,
  18. DimenConfig<SizeDimen> spacing = DefaultConfigs.spacing,
  19. DimenConfig<SizeDimen> stroke = DefaultConfigs.stroke,
  20. DimenConfig<WeightDimen> fontWeight = DefaultConfigs.fontWeight,
})

Implementation

DimenInitializer({
  // CONFIGS
  DeviceConfig? deviceConfig,
  DeviceType? deviceType,
  Iterable<DimenConfigData> dimens = const [],
  // CONSTRAINT DIMENS
  DimenConfig<ConstraintDimen> appbar = DefaultConfigs.appbar,
  DimenConfig<ConstraintDimen> bottom = DefaultConfigs.bottom,
  DimenConfig<ConstraintDimen> button = DefaultConfigs.button,
  DimenConfig<ConstraintDimen> image = DefaultConfigs.image,
  DimenConfig<ConstraintDimen> scaffold = DefaultConfigs.scaffold,
  // SIZE DIMENS
  DimenConfig<SizeDimen> avatar = DefaultConfigs.avatar,
  DimenConfig<SizeDimen> corner = DefaultConfigs.corner,
  DimenConfig<SizeDimen> divider = DefaultConfigs.divider,
  DimenConfig<SizeDimen> fontSize = DefaultConfigs.fontSize,
  DimenConfig<SizeDimen> icon = DefaultConfigs.icon,
  DimenConfig<SizeDimen> indicator = DefaultConfigs.indicator,
  DimenConfig<SizeDimen> logo = DefaultConfigs.logo,
  DimenConfig<SizeDimen> margin = DefaultConfigs.margin,
  DimenConfig<SizeDimen> padding = DefaultConfigs.padding,
  DimenConfig<SizeDimen> size = DefaultConfigs.size,
  DimenConfig<SizeDimen> spacing = DefaultConfigs.spacing,
  DimenConfig<SizeDimen> stroke = DefaultConfigs.stroke,
  // WEIGHT DIMENS
  DimenConfig<WeightDimen> fontWeight = DefaultConfigs.fontWeight,
})  : _config = deviceConfig,
      _type = deviceType {
  // CONSTRAINT DIMENS
  _dimens[DefaultDimenKeys.appbar] = appbar;
  _dimens[DefaultDimenKeys.bottom] = bottom;
  _dimens[DefaultDimenKeys.button] = button;
  _dimens[DefaultDimenKeys.image] = image;
  _dimens[DefaultDimenKeys.scaffold] = scaffold;
  // SIZE DIMENS
  _dimens[DefaultDimenKeys.avatar] = avatar;
  _dimens[DefaultDimenKeys.corner] = corner;
  _dimens[DefaultDimenKeys.divider] = divider;
  _dimens[DefaultDimenKeys.fontSize] = fontSize;
  _dimens[DefaultDimenKeys.icon] = icon;
  _dimens[DefaultDimenKeys.indicator] = indicator;
  _dimens[DefaultDimenKeys.logo] = logo;
  _dimens[DefaultDimenKeys.margin] = margin;
  _dimens[DefaultDimenKeys.padding] = padding;
  _dimens[DefaultDimenKeys.size] = size;
  _dimens[DefaultDimenKeys.space] = spacing;
  _dimens[DefaultDimenKeys.stroke] = stroke;
  // WEIGHT DIMENS
  _dimens[DefaultDimenKeys.fontWeight] = fontWeight;
  // CONFIGS
  if (dimens.isNotEmpty) {
    _dimens.addEntries(dimens.map((e) => MapEntry(e.name, e.config)));
  }
}