FSuper class

FSuper 是一个强大的组件,能够支持富文本、圆角、边框、图片、小红点、以及同时设置多达两个子组件,且能够通过相对位置控制它们。 FSuper 能够帮助开发者快速舒适的构建复杂视图。

FSuper is a powerful component that can support rich text, rounded corners, borders, pictures, small red dots, and set up to two sub-components at the same time, and control their relative positions. FSuper can help developers build complex views quickly and comfortably.

Inheritance

Constructors

FSuper({double? width, double? height, double? maxWidth, double? maxHeight, String? text, Alignment? textAlignment, TextAlign? textAlign, List<TextSpan>? spans, GestureTapCallback? onClick, Color? backgroundColor, ImageProvider<Object>? backgroundImage, Widget? child1, Alignment? child1Alignment, EdgeInsets? child1Margin, GestureTapCallback? onChild1Click, Widget? child2, Alignment? child2Alignment, EdgeInsets? child2Margin, GestureTapCallback? onChild2Click, bool redPoint = false, Color redPointColor = Colors.redAccent, double redPointSize = 20, Offset? redPointOffset, String? redPointText, TextStyle redPointTextStyle = const TextStyle(color: Colors.white, fontSize: 11), Gradient? gradient, EdgeInsetsGeometry? padding, FCorner? corner, FCornerStyle cornerStyle = FCornerStyle.round, Color? strokeColor, double? strokeWidth, Color? shadowColor, Offset? shadowOffset, double shadowBlur = 1, EdgeInsets? margin, TextStyle? style, StrutStyle? strutStyle, bool isSupportNeumorphism = false, Color? highlightShadowColor, FLightOrientation? lightOrientation, bool float = true})

Properties

backgroundColor Color?
组件背景颜色。
final
backgroundImage ImageProvider<Object>?
组件背景图片,会覆盖 backgroundColorgradient。详见 ImageProvider
final
child1 Widget?
子组件。子组件允许是任意类型的 Widget。 通过 child1Alignmentchild1Margin 可以控制它在组件中的位置。
final
child1Alignment Alignment?
指定 child1 在组件中的相对位置
final
child1Margin EdgeInsets?
基于 child1 的相对位置,为它设置偏移
final
child2 Widget?
子组件。子组件允许是任意类型的 Widget。 通过 child1Alignmentchild1Margin 可以控制它在组件中的位置。
final
child2Alignment Alignment?
指定 child2 在组件中的相对位置
final
child2Margin EdgeInsets?
基于 child2 的相对位置,为它设置偏移
final
corner FCorner?
设置组件圆角。详见 FCorner
final
cornerStyle FCornerStyle
设置圆角风格,默认 FCornerStyle.round
final
float bool
开启 Neumorphism 风格后,是否呈浮起效果,否则为凹陷效果,默认为 true
final
gradient Gradient?
设置组件渐变色背景。会覆盖 backgroundColor 你可选择 LinearGradientRadialGradientSweepGradient 等..
final
hashCode int
The hash code for this object.
no setterinherited
height double?
宽。null 将会自适应文字大小。
final
highlightShadowColor Color?
开启 Neumorphism 风格后,亮部阴影颜色
final
isSupportNeumorphism bool
是否支持 Neumorphism 风格。开启该项 highlightColor 将会失效
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lightOrientation FLightOrientation?
isSupportNeumorphism 为 true 时有效。光源方向,分为左上、左下、右上、右下四个方向。用来控制光源照射方向,会影响高亮方向和阴影方向
final
margin EdgeInsets?
设置组件与父容器边缘的间距。详见 EdgeInsets
final
maxHeight double?
组件最大高度
final
maxWidth double?
组件最大宽度。
final
onChild1Click GestureTapCallback?
child1 设置点击监听器
final
onChild2Click GestureTapCallback?
child2 设置点击监听器
final
onClick GestureTapCallback?
点击监听回调
final
padding EdgeInsetsGeometry?
设置组件内间距,只影响文字。通过该属性可以设置文字和 FSuper.child1FSuper.child2 的间距。
final
redPoint bool
是否显示小红点。默认不展示。
final
redPointColor Color
小红点颜色。默认 Colors.redAccent
final
redPointOffset Offset?
基于组件右上角设置 Red Point 的位置偏移。 默认 Red Point 会向右上方偏移 redPointSize / 2
final
redPointSize double
设置 Red Point 大小。Red Point 的 宽=高
final
redPointText String?
设置 Red Point 中的文字。比如消息数量..
final
redPointTextStyle TextStyle
小红点文本样式
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowBlur double
设置组件高斯与阴影形状卷积的标准偏差。
final
shadowColor Color?
设置组件阴影颜色
final
shadowOffset Offset?
设置组件阴影偏移
final
spans List<TextSpan>?
富文本内容。详见 TextSpanTextSpan 元素默认会使用 textColortextSizetextStyletextWeight 的配置。
final
strokeColor Color?
设置边框颜色。
final
strokeWidth double?
设置边框宽
final
strutStyle StrutStyle?
Widget 的文本区域样式
final
style TextStyle?
Widget 文本样式
final
text String?
文字内容
final
textAlign TextAlign?
文字对齐方式。详见 Align
final
textAlignment Alignment?
文字整体相对位置。详见 Alignment
final
width double?
宽。null 将会自适应文字大小。设置 double.infinity 将会充满父容器。
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
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

Static Methods

HorizontalSpace(double space) TextSpan
在富文本 spans 中插入水平方向的文字间距
VerticalSpace(double space) TextSpan
在富文本 spans 中插入垂直方向的文字间距