NapaDefaultTextStyle constructor

NapaDefaultTextStyle({
  1. required NapaTextStyle style,
  2. TextAlign? textAlign,
  3. bool softWrap = true,
  4. TextOverflow overflow = TextOverflow.clip,
  5. int? maxLines,
  6. TextWidthBasis textWidthBasis = TextWidthBasis.parent,
  7. NapaWidget? child,
})

Implementation

NapaDefaultTextStyle({
  required this.style,
  this.textAlign,
  this.softWrap = true,
  this.overflow = TextOverflow.clip,
  this.maxLines,
  this.textWidthBasis = TextWidthBasis.parent,
  this.child,
}) : super(childMode: NapaChildMode.singleChild) {
  properties.addAll([
    InspectableProperty<NapaTextStyle>(
      name: 'style',
      getValue: (obj) => style,
      setValue: (obj, value, customData) => style = value,
    ),
    InspectableProperty<Enum>(
      name: 'textAlign',
      nullable: true,
      getValue: (obj) => textAlign,
      setValue: (obj, value, customData) => textAlign = value,
      values: () => TextAlign.values,
    ),
    InspectableProperty<bool>(
      name: 'softWrap',
      getValue: (obj) => softWrap,
      setValue: (obj, value, customData) => softWrap = value,
    ),
    InspectableProperty<Enum>(
      name: 'overflow',
      getValue: (obj) => overflow,
      setValue: (obj, value, customData) => overflow = value,
      values: () => TextOverflow.values,
    ),
    InspectableProperty<int>(
      name: 'maxLines',
      nullable: true,
      getValue: (obj) => maxLines,
      setValue: (obj, value, customData) => maxLines = value,
    ),
    InspectableProperty<Enum>(
      name: 'textWidthBasis',
      getValue: (obj) => textWidthBasis,
      setValue: (obj, value, customData) => textWidthBasis = value,
      values: () => TextWidthBasis.values,
    ),
  ]);
}