UButton class

Inheritance
Available extensions

Constructors

UButton({Key? key, Color? color, EdgeInsetsGeometry? margin, double? width = double.infinity, double? height = 45, bool enabled = true, bool visible = true, Widget? child, String? text, GestureTapCallback? onTap, AlignmentGeometry? alignment = Alignment.center})

Properties

alignment AlignmentGeometry?
****** Align ****** ///
finalinherited
backgroundImage ImageProvider<Object>?
foregroundImage > foregroundColor > backgroundImage > color
finalinherited
behavior HitTestBehavior
HitTestBehavior.opaque 自己处理事件 HitTestBehavior.deferToChild child处理事件 HitTestBehavior.translucent 自己和child都可以接收事件
finalinherited
blendMode BlendMode
finalinherited
borderRadius BorderRadius?
ClipRRect剪辑半径
finalinherited
bottom double?
finalinherited
child Widget?
****** childchildren ****** /// child < children 两个只有一个有效
finalinherited
children List<Widget>?
finalinherited
clipBehavior Clip?
控制剪辑方式 Clip.none没有剪辑 最快 Clip.hardEdge不抗锯齿 快 Clip.antiAlias抗锯齿 慢 Clip.antiAliasWithSaveLayer抗锯齿和saveLayer 很慢 使用到的组件StackClipRRectClipPathClipRectClipOvalStackFlexSingleChildScrollView
finalinherited
clipper CustomClipper?
****** ClipRRectClipPathClipRectClipOval ****** /// RRectPathRect
finalinherited
color Color?
****** ColoredBox || DecoratedBox || CircleAvatar ****** ///
finalinherited
constraints BoxConstraints?
****** ConstrainedBox ****** ///
finalinherited
createRectTween CreateRectTween?
finalinherited
crossAxisAlignment CrossAxisAlignment
finalinherited
decoration Decoration?
****** DecoratedBox ****** ///
finalinherited
direction Axis
finalinherited
dragStartBehavior DragStartBehavior
GestureDetectorSingleChildScrollView 使用
finalinherited
enabled bool
****** 点击事件相关 ****** /// enabled默认为false (enabled=false) 除onTapGestureDetector属性无效 (enabled=true) GestureDetector属性全部有效
finalinherited
excludeFromSemantics bool
finalinherited
expand bool
****** SizedBox ****** ///
finalinherited
expanded bool
expanded=true flex=1 相当于添加Expanded组件
finalinherited
filter ImageFilter?
****** ImageFilter ****** ///
finalinherited
fit BoxFit?
****** FittedBox ****** ///
finalinherited
flex int?
****** Flexible ****** ///
finalinherited
flightShuttleBuilder HeroFlightShuttleBuilder?
finalinherited
foregroundColor Color?
finalinherited
foregroundDecoration Decoration?
finalinherited
foregroundImage ImageProvider<Object>?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height double?
finalinherited
heightFactor double?
finalinherited
heroTag String?
****** Hero ****** ///
finalinherited
intrinsicHeight bool
****** IntrinsicHeightIntrinsicWidth ****** ///
finalinherited
intrinsicWidth bool
finalinherited
isCircleAvatar bool
****** CircleAvatar ****** ///
finalinherited
isClipRect bool
finalinherited
isClipRRect bool
finalinherited
isOval bool
finalinherited
isScroll bool
****** 开启滚动 ****** ///
finalinherited
isStack bool
****** Stack ****** ///
finalinherited
isWrap bool
****** Wrap ****** ///
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior
finalinherited
left double?
****** Positioned ****** ///
finalinherited
mainAxisAlignment MainAxisAlignment
****** Flex=Column+Row ****** ///
finalinherited
mainAxisSize MainAxisSize
finalinherited
maintainAnimation bool
finalinherited
maintainInteractivity bool
finalinherited
maintainSemantics bool
finalinherited
maintainSize bool
finalinherited
maintainState bool
finalinherited
margin EdgeInsetsGeometry?
****** Padding ****** ///
finalinherited
maxRadius double?
finalinherited
minRadius double?
finalinherited
noScrollBehavior bool
移出头部和底部蓝色阴影
finalinherited
offstage bool
finalinherited
onBackgroundImageError ImageErrorListener?
finalinherited
onDoubleTap GestureTapCallback?
用户在短时间内触摸了屏幕两次
finalinherited
onDoubleTapCancel GestureTapCancelCallback?
finalinherited
onDoubleTapDown GestureTapDownCallback?
finalinherited
onForcePressEnd GestureForcePressEndCallback?
finalinherited
onForcePressPeak GestureForcePressPeakCallback?
finalinherited
onForcePressStart GestureForcePressStartCallback?
finalinherited
onForcePressUpdate GestureForcePressUpdateCallback?
finalinherited
onForegroundImageError ImageErrorListener?
finalinherited
onHorizontalDragCancel GestureDragCancelCallback?
onHorizontalDragDown没有成功完成时触发
finalinherited
onHorizontalDragDown GestureDragDownCallback?
当一个触摸点开始跟屏幕交互,同时在水平方向上移动时触发
finalinherited
onHorizontalDragEnd GestureDragEndCallback?
水平拖拽结束时触发
finalinherited
onHorizontalDragStart GestureDragStartCallback?
当触摸点开始在水平方向上移动时触发
finalinherited
onHorizontalDragUpdate GestureDragUpdateCallback?
屏幕上的触摸点位置每次改变时,都会触发这个回调
finalinherited
onLongPress GestureLongPressCallback?
用户触摸屏幕时间超过500ms时触发
finalinherited
onLongPressCancel GestureLongPressCancelCallback?
finalinherited
onLongPressDown GestureLongPressDownCallback?
finalinherited
onLongPressEnd GestureLongPressEndCallback?
用户触摸屏幕时间超过500ms时触发结束
finalinherited
onLongPressMoveUpdate GestureLongPressMoveUpdateCallback?
用户触摸屏幕时间超过500ms时移动触摸
finalinherited
onLongPressStart GestureLongPressStartCallback?
用户触摸屏幕时间超过500ms时触发开始
finalinherited
onLongPressUp GestureLongPressUpCallback?
用户触摸屏幕时间超过500ms时抬起触发
finalinherited
onPanCancel GestureDragCancelCallback?
用户触摸了屏幕,但是没有完成Tap的动作时触发
finalinherited
onPanDown GestureDragDownCallback?
当触摸点开始跟屏幕交互时触发
finalinherited
onPanEnd GestureDragEndCallback?
pan操作完成时触发
finalinherited
onPanStart GestureDragStartCallback?
当触摸点开始移动时触发
finalinherited
onPanUpdate GestureDragUpdateCallback?
屏幕上的触摸点位置每次改变时,都会触发这个回调
finalinherited
onScaleEnd GestureScaleEndCallback?
触摸点不再跟屏幕有任何交互,同时也表示这个scale手势完成
finalinherited
onScaleStart GestureScaleStartCallback?
触摸点开始跟屏幕交互时触发,同时会建立一个焦点为1.0
finalinherited
onScaleUpdate GestureScaleUpdateCallback?
跟屏幕交互时触发,同时会标示一个新的焦点
finalinherited
onSecondaryLongPress GestureLongPressCallback?
finalinherited
onSecondaryLongPressCancel GestureLongPressCancelCallback?
finalinherited
onSecondaryLongPressDown GestureLongPressDownCallback?
finalinherited
onSecondaryLongPressEnd GestureLongPressEndCallback?
finalinherited
onSecondaryLongPressMoveUpdate GestureLongPressMoveUpdateCallback?
finalinherited
onSecondaryLongPressStart GestureLongPressStartCallback?
finalinherited
onSecondaryLongPressUp GestureLongPressCallback?
finalinherited
onSecondaryTap GestureTapCallback?
finalinherited
onSecondaryTapCancel GestureTapCancelCallback?
finalinherited
onSecondaryTapDown GestureTapDownCallback?
****** GestureDetector ****** ///
finalinherited
onSecondaryTapUp GestureTapUpCallback?
finalinherited
onTap GestureTapCallback?
手指点击时的回调函数
finalinherited
onTapCancel GestureTapCancelCallback?
手指取消点击时的回调函数
finalinherited
onTapDown GestureTapDownCallback?
手指按下时的回调函数
finalinherited
onTapUp GestureTapUpCallback?
手指松开时的回调函数
finalinherited
onTertiaryLongPress GestureLongPressCallback?
finalinherited
onTertiaryLongPressCancel GestureLongPressCancelCallback?
finalinherited
onTertiaryLongPressDown GestureLongPressDownCallback?
finalinherited
onTertiaryLongPressEnd GestureLongPressEndCallback?
finalinherited
onTertiaryLongPressMoveUpdate GestureLongPressMoveUpdateCallback?
finalinherited
onTertiaryLongPressStart GestureLongPressStartCallback?
finalinherited
onTertiaryLongPressUp GestureLongPressUpCallback?
finalinherited
onTertiaryTapCancel GestureTapCancelCallback?
finalinherited
onTertiaryTapDown GestureTapDownCallback?
finalinherited
onTertiaryTapUp GestureTapUpCallback?
finalinherited
onVerticalDragCancel GestureDragCancelCallback?
用户突然停止拖拽时触发
finalinherited
onVerticalDragDown GestureDragDownCallback?
当一个触摸点开始跟屏幕交互,同时在垂直方向上移动时触发
finalinherited
onVerticalDragEnd GestureDragEndCallback?
当用户停止移动,这个拖拽操作就被认为是完成了,就会触发这个回调
finalinherited
onVerticalDragStart GestureDragStartCallback?
当触摸点开始在垂直方向上移动时触发
finalinherited
onVerticalDragUpdate GestureDragUpdateCallback?
屏幕上的触摸点位置每次改变时,都会触发这个回调
finalinherited
opacity double?
****** Opacity ****** ///
finalinherited
origin Offset?
finalinherited
padding EdgeInsetsGeometry?
finalinherited
physics ScrollPhysics?
****** SingleChildScrollView ****** ///
finalinherited
placeholderBuilder HeroPlaceholderBuilder?
finalinherited
primary bool?
finalinherited
radius double?
finalinherited
refreshConfig RefreshConfig?
****** Refreshed ****** ///
finalinherited
replacement Widget
****** Visibility ****** ///
finalinherited
restorationId String?
finalinherited
reverse bool
finalinherited
finalinherited
runAlignment WrapAlignment
finalinherited
runSpacing double
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeBottom bool
finalinherited
safeLeft bool
****** SafeArea ****** ///
finalinherited
safeRight bool
finalinherited
safeTop bool
finalinherited
scrollController ScrollController?
finalinherited
scrollDirection Axis?
finalinherited
size Size?
finalinherited
sized bool
finalinherited
stackFit StackFit
finalinherited
stepHeight double?
finalinherited
stepWidth double?
finalinherited
systemOverlayStyle SystemUiOverlayStyle?
****** AnnotatedRegion ****** ///
finalinherited
textBaseline TextBaseline?
finalinherited
textDirection TextDirection?
finalinherited
top double?
finalinherited
transform Matrix4?
****** Transform ****** ///
finalinherited
transitionOnUserGestures bool
finalinherited
useSingleChildScrollView bool
是否使用 SingleChildScrollView创建滚动组件 页面逻辑复杂时 设置为 false 以提高滑动性能
finalinherited
verticalDirection VerticalDirection
finalinherited
visible bool
finalinherited
width double?
finalinherited
widthFactor double?
finalinherited
wrapAlignment WrapAlignment
finalinherited
wrapCrossAlignment WrapCrossAlignment
finalinherited
wrapSpacing double
finalinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
buildAnnotatedRegion(Widget current) Widget
inherited
buildBackdropFilter(Widget current) Widget
inherited
buildCircleAvatar(Widget current) Widget
inherited
buildClip(Widget current, {CustomClipper? clipper}) Widget
裁剪组件
inherited
buildFittedBox(Widget current) Widget
inherited
buildFlex(List<Widget> children) Widget
inherited
buildFlexible(Widget current) Widget
inherited
buildGestureDetector(Widget current) Widget
inherited
buildHero(Widget current) Widget
inherited
buildOffstage(Widget current) Widget
inherited
buildPadding(Widget current) Widget
inherited
buildRefreshed(List<Widget> slivers) Widget
inherited
buildSingleChildScrollView(Widget current) Widget
inherited
buildStack(List<Widget> children) Widget
inherited
buildVisibility(Widget current) Widget
inherited
buildWrap(List<Widget> children) Widget
inherited
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