Universal class

Inheritance
Implementers
Available Extensions

Constructors

Universal({Key? key, bool isScroll = false, bool useSingleChildScrollView = true, bool useListView = false, bool isStack = false, bool isWrap = false, bool expanded = false, bool expand = false, bool intrinsicHeight = false, bool intrinsicWidth = false, double? stepWidth, double? stepHeight, bool isOval = false, bool isClipRRect = false, bool isClipRect = false, bool visible = true, bool offstage = false, bool reverse = false, bool maintainState = false, bool transitionOnUserGestures = false, bool isCircleAvatar = false, bool maintainAnimation = false, bool maintainSize = false, bool maintainSemantics = false, bool maintainInteractivity = false, bool excludeFromSemantics = false, bool noScrollBehavior = true, bool sized = true, bool safeLeft = false, bool safeTop = false, bool safeRight = false, bool safeBottom = false, bool safeLTRB = false, bool enabled = false, double wrapSpacing = 0.0, double runSpacing = 0.0, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Widget replacement = const SizedBox.shrink(), StackFit stackFit = StackFit.loose, MainAxisSize mainAxisSize = MainAxisSize.max, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, WrapAlignment wrapAlignment = WrapAlignment.start, WrapAlignment runAlignment = WrapAlignment.start, WrapCrossAlignment wrapCrossAlignment = WrapCrossAlignment.start, VerticalDirection verticalDirection = VerticalDirection.down, Axis direction = Axis.vertical, Axis? scrollDirection, HitTestBehavior behavior = HitTestBehavior.opaque, BorderRadius? borderRadius, Color? color, AlignmentGeometry? alignment, Widget? child, List<Widget>? children, EdgeInsetsGeometry? padding, ScrollPhysics? physics, ScrollController? scrollController, bool? primary, Decoration? foregroundDecoration, Matrix4? transform, Offset? origin, BoxConstraints? constraints, double? width, double? height, EdgeInsetsGeometry? margin, Decoration? decoration, TextBaseline? textBaseline, TextDirection? textDirection, VoidCallback? onPressed, GestureTapCallback? onTap, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCancelCallback? onTapCancel, GestureTapDownCallback? onSecondaryTapDown, GestureTapUpCallback? onSecondaryTapUp, GestureTapCancelCallback? onSecondaryTapCancel, GestureTapCallback? onDoubleTap, GestureTapDownCallback? onDoubleTapDown, GestureTapCancelCallback? onDoubleTapCancel, GestureLongPressCallback? onLongPress, GestureLongPressCancelCallback? onLongPressCancel, GestureLongPressDownCallback? onLongPressDown, GestureLongPressStartCallback? onLongPressStart, GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate, GestureLongPressUpCallback? onLongPressUp, GestureLongPressEndCallback? onLongPressEnd, GestureDragDownCallback? onVerticalDragDown, GestureDragStartCallback? onVerticalDragStart, GestureDragUpdateCallback? onVerticalDragUpdate, GestureDragEndCallback? onVerticalDragEnd, GestureDragCancelCallback? onVerticalDragCancel, GestureDragDownCallback? onHorizontalDragDown, GestureDragStartCallback? onHorizontalDragStart, GestureDragUpdateCallback? onHorizontalDragUpdate, GestureDragEndCallback? onHorizontalDragEnd, GestureDragCancelCallback? onHorizontalDragCancel, GestureDragDownCallback? onPanDown, GestureDragStartCallback? onPanStart, GestureDragUpdateCallback? onPanUpdate, GestureDragEndCallback? onPanEnd, GestureDragCancelCallback? onPanCancel, GestureScaleStartCallback? onScaleStart, GestureScaleUpdateCallback? onScaleUpdate, GestureScaleEndCallback? onScaleEnd, GestureForcePressStartCallback? onForcePressStart, GestureForcePressPeakCallback? onForcePressPeak, GestureForcePressUpdateCallback? onForcePressUpdate, GestureForcePressEndCallback? onForcePressEnd, double? radius, String? heroTag, CreateRectTween? createRectTween, HeroFlightShuttleBuilder? flightShuttleBuilder, HeroPlaceholderBuilder? placeholderBuilder, ImageProvider<Object>? backgroundImage, ImageErrorListener? onBackgroundImageError, ImageErrorListener? onForegroundImageError, ImageProvider<Object>? foregroundImage, Color? foregroundColor, double? minRadius, double? maxRadius, CustomClipper? clipper, Size? size, GestureTapCallback? onSecondaryTap, GestureLongPressMoveUpdateCallback? onSecondaryLongPressMoveUpdate, GestureLongPressCallback? onSecondaryLongPressUp, GestureLongPressCallback? onSecondaryLongPress, GestureLongPressEndCallback? onSecondaryLongPressEnd, GestureLongPressStartCallback? onSecondaryLongPressStart, GestureLongPressCancelCallback? onSecondaryLongPressCancel, GestureLongPressDownCallback? onSecondaryLongPressDown, GestureLongPressCallback? onTertiaryLongPress, GestureLongPressCancelCallback? onTertiaryLongPressCancel, GestureLongPressDownCallback? onTertiaryLongPressDown, GestureLongPressEndCallback? onTertiaryLongPressEnd, GestureLongPressMoveUpdateCallback? onTertiaryLongPressMoveUpdate, GestureLongPressStartCallback? onTertiaryLongPressStart, GestureLongPressUpCallback? onTertiaryLongPressUp, GestureTapCancelCallback? onTertiaryTapCancel, GestureTapDownCallback? onTertiaryTapDown, GestureTapUpCallback? onTertiaryTapUp, double? left, double? top, double? right, double? bottom, int? flex, double? opacity, Clip? clipBehavior, double? widthFactor, double? heightFactor, ImageFilter? filter, BoxFit? fit, SystemUiOverlayStyle? systemOverlayStyle, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, String? restorationId, BlendMode blendMode = BlendMode.srcOver, UnifiedButtonCategory? unifiedButtonCategory, ValueChanged<bool>? onHover, ValueChanged<bool>? onFocusChange, ButtonStyle? style, FocusNode? focusNode, bool autofocus = false, MaterialStatesController? statesController})
const

Properties

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

Methods

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