defaultTextStyle method
Widget
defaultTextStyle({
- required TextStyle style,
- bool merge = true,
- Key? key,
- TextAlign? textAlign,
- bool softWrap = true,
- TextOverflow overflow = TextOverflow.clip,
- int? maxLines,
- TextWidthBasis textWidthBasis = TextWidthBasis.parent,
- TextHeightBehavior? textHeightBehavior,
The text style to apply to descendant Text widgets which don't have an explicit style.
If merge
is true, the style
is merged with other inherited
text attributes.
Implementation
Widget defaultTextStyle({
required TextStyle style,
bool merge = true,
Key? key,
TextAlign? textAlign,
bool softWrap = true,
TextOverflow overflow = TextOverflow.clip,
int? maxLines,
TextWidthBasis textWidthBasis = TextWidthBasis.parent,
TextHeightBehavior? textHeightBehavior,
}) {
if (merge) {
return DefaultTextStyle.merge(
key: key,
style: style,
textAlign: textAlign,
softWrap: softWrap,
overflow: overflow,
maxLines: maxLines,
textWidthBasis: textWidthBasis,
child: this,
);
}
return DefaultTextStyle(
key: key,
style: style,
textAlign: textAlign,
softWrap: softWrap,
overflow: overflow,
maxLines: maxLines,
textWidthBasis: textWidthBasis,
textHeightBehavior: textHeightBehavior,
child: this,
);
}