Txt class

A Text widget helper to avoid boilerplate.

The Txt widget expose a fill extra paramaters to style a Text it also offers a variety of constructors to create styled or themed Text

Inheritance

Constructors

Txt(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget.
const
Txt.b(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, String? fontFamily, bool italic = false})
Creates a txt widget with bold text.
const
Txt.bi(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, String? fontFamily})
Creates a txt widget with bold and italic text.
const
Txt.bodyText1(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with bodyText1 theme.
const
Txt.bodyText2(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with bodyText2 theme.
const
Txt.bs(String text, double? size, {Key? key, Color? color, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, String? fontFamily, bool italic = false})
Creates a bold txt widget with determined text size.
const
Txt.bsc(String text, double? size, Color? color, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, String? fontFamily, bool italic = false})
Creates a bold txt widget with determined text color and size.
const
Txt.button(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with button theme.
const
Txt.c(String text, Color? color, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with determined text color.
const
Txt.caption(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with caption theme.
const
Txt.headline1(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with headline1 theme.
const
Txt.headline2(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with headline2 theme.
const
Txt.headline3(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with headline3 theme.
const
Txt.headline4(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with headline4 theme.
const
Txt.headline5(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with headline5 theme.
const
Txt.headline6(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with headline6 theme.
const
Txt.i(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily})
Creates a txt widget with italic text.
const
Txt.overline(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with overline theme.
const
Txt.s(String text, double? size, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with determined text size.
const
Txt.sc(String text, double? size, Color? color, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with determined text color and size.
const
Txt.subtitle1(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with subtitle1 theme.
const
Txt.subtitle2(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? align, TextDirection? direction, Locale? locale, bool? softWrap, TextOverflow? overflow, double? scaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? widthBasis, double? size, Color? color, FontWeight? weight, String? fontFamily, bool italic = false})
Creates a txt widget with subtitle2 theme.
const

Properties

align TextAlign?
Text horizontal aligment
final
baseStyle TxtStyle
Text base style. Used to indicate themes
final
color Color?
Text color
final
direction TextDirection?
Text horizontal direction
final
fontFamily String?
T ext font family
final
hashCode int
The hash code for this object.
no setterinherited
italic bool
Indicates whether the text is italic
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale Locale?
Text locale
final
maxLines int?
Text maximum lines
final
overflow TextOverflow?
How visual overflow should be handled.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleFactor double?
Text scale factor
final
semanticsLabel String?
An alternative semantics label for this text.
final
size double?
Text size
final
softWrap bool?
Whether the text should break at soft line breaks.
final
strutStyle StrutStyle?
The strut style to use. Strut style defines the strut, which sets minimum vertical layout metrics.
final
style TextStyle?
Text style
final
text String
Text to display
final
weight FontWeight?
Text font weight
final
widthBasis TextWidthBasis?
Defines how to measure the width of the rendered text.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited