GradientTextWidget class

@example code

GradientWidget( clinicName + clinicName, showGradient: true, enableGradient: true, // gradientColor: Colors.amberAccent, gradientColors: Color.fromARGB(31, 234, 9, 123), Color.fromARGB(180, 234, 9, 123), Color.fromARGB(255, 234, 9, 123) , logicWidth: Get.width - 40.rpx, textColor: AppColors.COLOR_111111, )

Inheritance

Constructors

GradientTextWidget(String content, {num gradientWidth = 50, bool showGradient = false, GlobalObjectKey<State<StatefulWidget>>? objectKey, Color gradientColor = Colors.white, FontWeight fontWeight = FontWeight.w500, num textFontSize = 16, Color textColor = const Color(0xFF333333), ScrollController? scrollController, num? logicWidth, bool enableGradient = true, List<Color>? gradientColors})

Properties

content String
内容
final
enableGradient bool
开启渐变,且_showGradient同时开启
final
fontWeight FontWeight
字重
final
gradientColor Color
渐变颜色
final
gradientColors List<Color>?
渐变颜色,当该属性设置,gradientColor无效
getter/setter pair
gradientWidth num
渐变的宽度
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
logicWidth num?
当前节点在父视图布局的逻辑宽度,当设置该属性,且enableGradient开启,会根据当前节点的固有大小和该属性比较的值,赋值给_showGradient
final
objectKey GlobalObjectKey<State<StatefulWidget>>?
文字节点的key
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
用于监听滚动
getter/setter pair
showGradient bool
外部设置是否显示渐变,最终赋值给_showGradient,因此主要由_showGradient和enableGradient决定
final
textColor Color
字体颜色
final
textFontSize num
字体大小
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, 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