DefaultTextStyleModifier constructor

const DefaultTextStyleModifier({
  1. Key? key,
  2. Widget? child,
  3. Key? modifierKey,
  4. required TextStyle style,
  5. TextAlign? textAlign,
  6. bool softWrap = true,
  7. TextOverflow overflow = TextOverflow.clip,
  8. int? maxLines,
  9. TextWidthBasis textWidthBasis = TextWidthBasis.parent,
  10. TextHeightBehavior? textHeightBehavior,
})

Creates a default text style for the given subtree.

Consider using DefaultTextStyle.merge to inherit styling information from the current default text style for a given BuildContext.

The style and child arguments are required and must not be null.

The softWrap and overflow arguments must not be null (though they do have default values).

The maxLines property may be null (and indeed defaults to null), but if it is not null, it must be greater than zero.

Implementation

const DefaultTextStyleModifier({
  super.key,
  super.child,
  super.modifierKey,
  required this.style,
  this.textAlign,
  this.softWrap = true,
  this.overflow = TextOverflow.clip,
  this.maxLines,
  this.textWidthBasis = TextWidthBasis.parent,
  this.textHeightBehavior,
});