heading text in flutter code example
Example 1: how to use theme style and textstyle together in flutter text widget
Theme.of(context)
.textTheme.display1
.merge(TextStyle(color: Colors.red)
Example 2: italic text flutter
Text(
"Welcome to the present, we're running a real nation.",
style: TextStyle(fontStyle: FontStyle.italic),
)
Example 3: flutter text wisget
const Text(
this.data, {
Key key,
this.style,
this.strutStyle,
this.textAlign,
this.textDirection,
this.locale,
this.softWrap,
this.overflow,
this.textScaleFactor,
this.maxLines,
this.semanticsLabel,
this.textWidthBasis,
this.textHeightBehavior,
}) : assert(
data != null,
'A non-null String must be provided to a Text widget.',
),
textSpan = null,
_applyTextScaleFactorToWidgetSpan = true,
super(key: key);