TextExtension extension
Text extension to directly style on Text
- on
Properties
- body1 → Text
-
Sets fontSize to 16 logical pixel and
fontWeight
to Lightno setter - body2 → Text
-
Sets fontSize to 14 logical pixel and
fontWeight
to Lightno setter - bold → Text
-
Sets
fontWeight
to FontWeight.w600no setter -
Sets fontSize to 12 logical pixel and
fontWeight
to Lightno setter -
Sets fontSize to 10 logical pixel and
fontWeight
to Lightno setter - clip → Text
-
Clip the overflowing text to fix its container.
no setter
- darkBold → Text
-
Sets
fontWeight
to FontWeight.w900no setter - ellipsis → Text
-
Use an ellipsis to indicate that the text has overflowed.
no setter
- extraBold → Text
-
Sets
fontWeight
to FontWeight.w800no setter - extraLight → Text
-
Sets
fontWeight
to FontWeight.w200no setter - fade → Text
-
Fade
the overflowing text to transparent.no setter - h1 → Text
-
Sets fontSize to 96 logical pixel and
fontWeight
to lightno setter - h2 → Text
-
Sets fontSize to 60 logical pixel and
fontWeight
to lightno setter - h3 → Text
-
Sets fontSize to 48 logical pixel and
fontWeight
to regularno setter - h4 → Text
-
Sets fontSize to 34 logical pixel and
fontWeight
to regularno setter - h5 → Text
-
Sets fontSize to 24 logical pixel and
fontWeight
to regularno setter - h6 → Text
-
Sets fontSize to 20 logical pixel and
fontWeight
to mediumno setter - italic → Text
-
Use glyphs designed for slanting
no setter
- lg → Text
-
Sets TextScaler to large i.e. 1.125
no setter
- light → Text
-
Sets
fontWeight
to FontWeight.w300no setter - md → Text
-
Sets TextScaler to md i.e. 1 or default
no setter
- medium → Text
-
Sets
fontWeight
to FontWeight.w500no setter - normal → Text
-
Sets
fontWeight
to FontWeight.w400no setter - rtl → Text
-
The text flows from right to left (e.g. Arabic, Hebrew).
no setter
- semiBold → Text
-
Sets
fontWeight
to FontWeight.w700no setter - sm → Text
-
Sets TextScaler to small i.e. 0.875
no setter
- textCenter → Text
-
Align the text in the center of the container.
no setter
- textEnd → Text
-
Align the text end edge of the container
no setter
- textJustify → Text
-
Lines that end with hard line breaks are aligned towards the
start
edge.no setter - textLeft → Text
-
Align the text on the left edge of the container.
no setter
- textRight → Text
-
Align the text on the right edge of the container.
no setter
- textStart → Text
-
Align the text start edge of the container
no setter
- thin → Text
-
Sets
fontWeight
to FontWeight.w100no setter - underline → Text
-
Draw a line underneath each line of text
no setter
- visible → Text
-
Render overflowing text outside of its container.
no setter
- xl → Text
-
Sets TextScaler to extra large i.e. 1.25
no setter
- xl2 → Text
-
Sets TextScaler to twice extra large i.e. 1.5
no setter
- xl3 → Text
-
Sets TextScaler to thrice extra large i.e. 1.875
no setter
- xl4 → Text
-
Sets TextScaler to four times extra large i.e. 2.25
no setter
- xl5 → Text
-
Sets TextScaler to five times extra large i.e. 3
no setter
- xl6 → Text
-
Sets TextScaler to six times extra large i.e. 4
no setter
- xs → Text
-
Sets TextScaler to extra small i.e. 0.75
no setter
Methods
-
bgColor(
Color backgroundColor) → Text -
Sets text background color with either Colors or
FxColors
-
color(
Color color) → Text -
Sets text color with either Colors or
FxColors
-
fontFamily(
String fontFamily) → Text - Set fontFamily for the text
-
fontSize(
double fontSize) → Text - Sets fontSize to this text
-
letterSpacing(
double spacing) → Text - A negative value can be used to bring the letters closer.
-
lineHeight(
double height) → Text -
Sets custom lineHeight with
height
-
maxLine(
[int? maxLines]) → Text - An optional maximum number of lines for the text to span, wrapping if necessary.
-
softWrap(
bool softWrap) → Text - If false, the glyphs in the text will be positioned as if there was unlimited horizontal space.
-
style(
{Key? key, TextStyle? style, StrutStyle? strutStyle, bool? softWrap, TextOverflow? overflow, TextDirection? textDirection, Locale? locale, String? semanticsLabel, TextScaler? textScaler, TextWidthBasis? textWidthBasis, int? maxLines, TextAlign? textAlign}) → Text - Apply TextStyle to existing textstyle
-
textScale(
TextScaler textScaler) → Text - set TextScaler to text
-
wordSpacing(
double spacing) → Text - The amount of space (in logical pixels) to add at each sequence of white-space