SilButton class

Inheritance

Constructors

SilButton({String? imgPath, double? imgHeight, double? imgWidth, BoxFit? imgFit, Widget? placeholderImgWidget, String? placeholderImgPath, String? errorImgPath, Color? imgBorderColor, double? imgBorderWidth, double? imgRadius, String? title, TextStyle? titleStyle, Color? titleColor, double? fontSize, FontWeight? fontWeight, String? fontFamily, double? lineHeight, int? maxLines, double? space, ImagePosition? imagePosition = ImagePosition.Right, TextAlign? textAlign, TextDirection? textDirection, String? packageName, Key? key, double? height, double? width, double? radius, BorderRadiusGeometry? borderRadius, void onTapFunc()?, void onLongPress()?, double? borderWidth, Color? borderColor, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, AlignmentGeometry? alignment, Color? backgroundColor, bool useConstrained = false})
const

Properties

alignment AlignmentGeometry?
对齐方式
finalinherited
backgroundColor Color?
背景颜色
finalinherited
behavior HitTestBehavior?
点击区域
finalinherited
borderColor Color?
边框颜色
finalinherited
borderRadius BorderRadiusGeometry?
自定义圆角
finalinherited
borderWidth double?
边框宽度
finalinherited
child Widget?
child
finalinherited
decoration BoxDecoration
装饰
no setterinherited
errorImgPath String?
网络错误时显示,本地图片地址
final
fontFamily String?
标题字体
final
fontSize double?
标题字体大小
final
fontWeight FontWeight?
标题字体权重
final
hashCode int
The hash code for this object.
no setterinherited
height double?
高度
finalinherited
imagePosition ImagePosition?
图标的位置,默认在右侧
final
imageWidget Widget
图片
no setter
imgBorderColor Color?
图片边框颜色
final
imgBorderWidth double?
图片边框宽度
final
imgFit BoxFit?
填充方式
final
imgHeight double?
图片的高度
final
imgPath String?
图片地址,可以传网络图片、本地图片地址,自动判断处理
final
imgRadius double?
图片切角弧度
final
imgWidth double?
图片的宽度
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lineHeight double?
行高,此文本跨度的高度,为字体大小的倍数
final
margin EdgeInsetsGeometry?
外间距
finalinherited
maxLines int?
最大行数
final
onLongPress → void Function()?
长按
finalinherited
onTapFunc → void Function()?
点击回调函数
finalinherited
packageName String?
包名
final
padding EdgeInsetsGeometry?
内间距
finalinherited
placeholderImgPath String?
占位图,本地图片地址,没有设置placeholderImgWidget时,才起作用
final
placeholderImgWidget Widget?
自定义图片占位
final
radius double?
圆角弧度(装饰用,子组件切圆角,需要自己处理)
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
space double?
文字和图片的间距,默认4
final
textAlign TextAlign?
对齐方式,默认靠左
final
textDirection TextDirection?
文本显示方向,默认从左到右
final
title String?
标题
final
titleColor Color?
标题颜色
final
titleStyle TextStyle?
标题样式
final
titleWidget Widget
文本
no setter
useConstrained bool
是否使用上级的约束,默认不使用
finalinherited
width double?
宽度
finalinherited

Methods

bgWidget({Widget? child}) Widget
按钮背景
inherited
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