T class
A Text widget helper to avoid boilerplate.
The T 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
- T(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
- T.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
- T.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
- T.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.
- T.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.
- T.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
- T.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
- Creates a txt widget with button theme.
- T.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
- Creates a txt widget with caption theme.
- T.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.
- T.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.
- T.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.
- T.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.
- T.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.
- T.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.
- T.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
- T.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.
- T.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
- T.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
- T.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.
- T.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.
Properties
- align → TextAlign?
-
文字布局
final
- baseStyle → TxtStyle?
-
基本样式
final
- color → Color?
-
颜色
final
- direction → TextDirection?
-
文字方向
final
- fontFamily → String?
-
字体
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- italic → bool
-
斜体
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- locale → Locale?
-
多语言地域
final
- maxLines → int?
-
最大行数
final
- overflow → TextOverflow?
-
溢出显示
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleFactor → double?
-
缩放
final
- semanticsLabel → String?
-
An alternative semantics label for this text.
final
- size → double?
-
尺寸
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?
-
文字样式
final
- text → String
-
文字内容
final
- weight → FontWeight?
-
粗度,字重
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