MXText class
----------------------------------------------------------------------文字组件 使用该组件能让中文在android机中强制居中
- Inheritance
Constructors
- MXText({Key? key, dynamic data, MXFontStyle? font, bool isNumber = false, FontWeight? fontWeight, FontFamily? fontFamily, Color? textColor, Color? backgroundColor, String? package = 'mx_widget', bool? isTextThrough = false, Color? lineThroughColor, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, double? textScaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, InlineSpan? textSpan, bool forceVerticalCenter = true, bool isLine = true})
Properties
- backgroundColor → Color?
-
背景颜色
final
- data → dynamic
-
以下系统text属性,释义请参考系统Text中注释
final
- font → MXFontStyle?
-
final
- fontFamily → FontFamily?
-
字体ttf
final
- fontWeight → FontWeight?
-
字体粗细
final
- forceVerticalCenter → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLine → bool
-
是否居中,如果是则采用居中算法的字体,但是该方法会导致文字无法换行
final
- isNumber → bool
-
是否是数字类型,采用将使用字体为DIN显示数字类型
final
- isTextThrough → bool?
-
是否是横线穿过样式(删除线)
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lineThroughColor ↔ Color?
-
删除线颜色,对应TestStyle的decorationColor
getter/setter pair
- locale → Locale?
-
final
- maxLines → int?
-
final
- overflow → TextOverflow?
-
final
- package → String?
-
项目字体包名
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticsLabel → String?
-
final
- softWrap → bool?
-
final
- strutStyle → StrutStyle?
-
final
- style → TextStyle?
-
自定义的TextStyle,其中指定的属性,将覆盖扩展的外层属性
final
- textAlign → TextAlign?
-
final
- textColor ↔ Color?
-
文本颜色
getter/setter pair
- textDirection → TextDirection?
-
final
- textHeightBehavior → TextHeightBehavior?
-
final
- textScaleFactor → double?
-
final
- textSpan → InlineSpan?
-
final
- textWidthBasis → TextWidthBasis?
-
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
-
getConfiguration(
BuildContext context) → TextConfiguration? -
getRawText(
{BuildContext? context}) → Text - 获取系统原始Text,以便使用到只能接收系统Text组件的地方 转化为系统原始Text后,将失去padding和background属性
-
getTextStyle(
BuildContext? context, {double? height, Color? backgroundColor, String? fontfamily}) → TextStyle? -
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, int wrapWidth = 65}) → 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