Universal class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Universal
- Available extensions
Constructors
-
Universal({Key? key, bool addCard = false, bool addInkWell = false, bool isScroll = false, bool useSingleChildScrollView = true, bool isStack = false, bool isWrap = false, bool expanded = false, bool expand = false, bool shrink = false, bool intrinsicHeight = false, bool intrinsicWidth = false, bool isOval = false, bool isClipRRect = false, bool isClipRect = false, bool visible = true, bool offstage = false, bool enabled = false, bool reverse = false, bool autoFocus = 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? enableFeedback = true, bool canRequestFocus = true, bool noScrollBehavior = true, bool sized = true, bool gaussian = false, bool safeLeft = false, bool safeTop = false, bool safeRight = false, bool safeBottom = false, double fuzzyDegree = 4, double wrapSpacing = 0.0, double runSpacing = 0.0, DragStartBehavior dragStartBehavior = DragStartBehavior.start, Color? shadowColor = Colors.transparent, 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, GestureTapCallback? onTap, GestureTapDownCallback? onTapDown, GestureTapUpCallback? onTapUp, GestureTapCancelCallback? onTapCancel, GestureTapDownCallback? onSecondaryTapDown, GestureTapUpCallback? onSecondaryTapUp, GestureTapCancelCallback? onSecondaryTapCancel, GestureTapCallback? onDoubleTap, GestureLongPressCallback? onLongPress, 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, ShapeBorder? shape, ValueChanged<bool> ? onHighlightChanged, ValueChanged<bool> ? onHover, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, InteractiveInkFeatureFactory? splashFactory, double? radius, ShapeBorder? customBorder, FocusNode? focusNode, ValueChanged<bool> ? onFocusChange, String? heroTag, CreateRectTween? createRectTween, HeroFlightShuttleBuilder? flightShuttleBuilder, HeroPlaceholderBuilder? placeholderBuilder, ImageProvider<Object> ? backgroundImage, ImageErrorListener? onBackgroundImageError, Color? foregroundColor, double? minRadius, double? maxRadius, CustomClipper? clipper, Size? size, GestureTapCallback? onSecondaryTap, GestureLongPressMoveUpdateCallback? onSecondaryLongPressMoveUpdate, GestureLongPressCallback? onSecondaryLongPressUp, GestureLongPressCallback? onSecondaryLongPress, GestureLongPressEndCallback? onSecondaryLongPressEnd, GestureLongPressStartCallback? onSecondaryLongPressStart, double? left, double? top, double? right, double? bottom, int? flex, double? elevation, double? opacity, Clip? clipBehavior, RefreshConfig? refreshConfig, double? widthFactor, double? heightFactor, ImageFilter? filter, dynamic builder, BoxFit? fit, SystemUiOverlayStyle? systemOverlayStyle}) -
const
Properties
- addCard → bool
-
****** Card ****** ///
final
- addInkWell → bool
-
addInkWell添加InkWell 有水波纹效果
final
- alignment → AlignmentGeometry?
-
****** Align ****** ///
final
- autoFocus → bool
-
自动获取焦点
final
-
backgroundImage
→ ImageProvider<
Object> ? -
final
- behavior → HitTestBehavior
-
HitTestBehavior.opaque 自己处理事件
HitTestBehavior.deferToChild child处理事件
HitTestBehavior.translucent 自己和child都可以接收事件
final
- borderRadius → BorderRadius?
-
InkWell飞溅半径
Material圆角半径
ClipRRect剪辑半径
final
- bottom → double?
-
final
- builder → dynamic
-
****** StatefulBuilder、Builder、LayoutBuilder ****** ///
builder types LayoutWidgetBuilder、WidgetBuilder、StatefulWidgetBuilder
final
- canRequestFocus → bool
-
final
- child → Widget?
-
****** child、children、builder ****** ///
child < children < builder
三个只有一个有效
final
-
children
→ List<
Widget> ? -
final
- clipBehavior → Clip?
-
控制剪辑方式
Clip.none没有剪辑 最快
Clip.hardEdge不抗锯齿 快
Clip.antiAlias抗锯齿 慢
Clip.antiAliasWithSaveLayer抗锯齿和saveLayer 很慢
使用到的组件Stack、ClipRRect、ClipPath、ClipRect、ClipOval、Container、Material、Card、Stack、SingleChildScrollView
final
- clipper → CustomClipper?
-
****** ClipRRect、ClipPath、ClipRect、ClipOval ****** ///
RRect、Path、Rect
final
- color → Color?
-
****** ColoredBox||DecoratedBox ****** ///
final
- constraints → BoxConstraints?
-
****** ConstrainedBox ****** ///
final
- createRectTween → CreateRectTween?
-
final
- crossAxisAlignment → CrossAxisAlignment
-
final
- customBorder → ShapeBorder?
-
覆盖borderRadius的自定义剪辑边框
final
- decoration → Decoration?
-
****** DecoratedBox ****** ///
final
- direction → Axis
-
final
- dragStartBehavior → DragStartBehavior
-
GestureDetector、SingleChildScrollView 使用
final
- elevation → double?
-
final
- enabled → bool
-
enabled默认为false addInkWell默认为false
(enabled=false || addInkWell=true ) 除onTap外GestureDetector属性无效
(enabled=true && addInkWell=false ) GestureDetector属性全部有效
final
- enableFeedback → bool?
-
检测到的手势是否应该提供声音和/或触觉反馈,默认true
final
- excludeFromSemantics → bool
-
final
- expand → bool
-
****** SizedBox ****** ///
final
- expanded → bool
-
expanded=true flex=1 相当于添加Expanded组件
final
- filter → ImageFilter?
-
****** ImageFilter ****** ///
filter!=null 时 fuzzyDegree 无效
final
- fit → BoxFit?
-
****** FittedBox ****** ///
final
- flex → int?
-
****** Flexible ****** ///
final
- flightShuttleBuilder → HeroFlightShuttleBuilder?
-
final
- focusColor → Color?
-
获取焦点颜色
final
- focusNode → FocusNode?
-
焦点管理
final
- foregroundColor → Color?
-
final
- foregroundDecoration → Decoration?
-
final
- fuzzyDegree → double
-
模糊程度 0-100
final
- gaussian → bool
-
是否开始背景模糊 ImageFilter
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
final
- heightFactor → double?
-
final
- heroTag → String?
-
****** Hero ****** ///
final
- highlightColor → Color?
-
点击时的颜色
final
- hoverColor → Color?
-
指针悬停时颜色
final
- intrinsicHeight → bool
-
****** IntrinsicHeight、IntrinsicWidth ****** ///
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
- 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
-
onFocusChange
→ ValueChanged<
bool> ? -
焦点变化回调
final
- onForcePressEnd → GestureForcePressEndCallback?
-
final
- onForcePressPeak → GestureForcePressPeakCallback?
-
final
- onForcePressStart → GestureForcePressStartCallback?
-
final
- onForcePressUpdate → GestureForcePressUpdateCallback?
-
final
-
onHighlightChanged
→ ValueChanged<
bool> ? -
****** 点击事件相关 ****** ///
****** InkWell ****** ///
高亮变化回调
当材料的这一部分突出显示或停止突出显示时调用
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
- 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
- onScaleEnd → GestureScaleEndCallback?
-
触摸点不再跟屏幕有任何交互,同时也表示这个scale手势完成
final
- onScaleStart → GestureScaleStartCallback?
-
触摸点开始跟屏幕交互时触发,同时会建立一个焦点为1.0
final
- onScaleUpdate → GestureScaleUpdateCallback?
-
跟屏幕交互时触发,同时会标示一个新的焦点
final
- onSecondaryLongPress → GestureLongPressCallback?
-
final
- onSecondaryLongPressEnd → GestureLongPressEndCallback?
-
final
- onSecondaryLongPressMoveUpdate → GestureLongPressMoveUpdateCallback?
-
final
- onSecondaryLongPressStart → GestureLongPressStartCallback?
-
final
- onSecondaryLongPressUp → GestureLongPressCallback?
-
final
- onSecondaryTap → GestureTapCallback?
-
final
- onSecondaryTapCancel → GestureTapCancelCallback?
-
final
- onSecondaryTapDown → GestureTapDownCallback?
-
final
- onSecondaryTapUp → GestureTapUpCallback?
-
final
- onTap → GestureTapCallback?
-
短暂触摸屏幕时触发
final
- onTapCancel → GestureTapCancelCallback?
-
短暂触摸屏幕时触发取消
final
- onTapDown → GestureTapDownCallback?
-
用户每次和屏幕交互时都会被调用
final
- onTapUp → GestureTapUpCallback?
-
****** GestureDetector ****** ///
点击抬起
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
- refreshConfig → RefreshConfig?
-
******
Refreshed
****** ///final - replacement → Widget
-
****** Visibility ****** ///
final
- reverse → bool
-
final
- right → double?
-
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
- safeRight → bool
-
final
- safeTop → bool
-
final
- scrollController → ScrollController?
-
final
- scrollDirection → Axis?
-
final
- shadowColor → Color?
-
final
- shape → ShapeBorder?
-
final
- shrink → bool
-
final
- size → Size?
-
final
- sized → bool
-
final
- splashColor → Color?
-
水波纹颜色
final
- splashFactory → InteractiveInkFeatureFactory?
-
自定义水波纹
final
- stackFit → StackFit
-
final
- systemOverlayStyle → SystemUiOverlayStyle?
-
****** AnnotatedRegion ****** ///
final
- textBaseline → TextBaseline?
-
final
- textDirection → TextDirection?
-
final
- top → double?
-
final
- transform → Matrix4?
-
****** Transform ****** ///
final
- transitionOnUserGestures → bool
-
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
-
annotatedRegionWidget(
Widget current) → Widget -
backdropFilter(
Widget current) → Widget -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
builderWidget(
Widget current) → Widget -
cardWidget(
Widget current, BuildContext context) → Widget -
circleAvatarWidget(
Widget current) → Widget -
clipWidget(
Widget current, {CustomClipper? clipper}) → 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
-
fittedBox(
Widget current) → Widget -
flexibleWidget(
Widget current) → Widget -
flexWidget(
List< Widget> children) → Widget -
gestureDetectorWidget(
Widget current) → Widget -
heroWidget(
Widget current) → Widget -
inkWellWidget(
Widget current) → Widget -
material(
Widget current, {required MaterialType mType, Color? mShadowColor, Color? mColor, TextStyle? mTextStyle, required double mElevation, BorderRadiusGeometry? mBorderRadius, ShapeBorder? mShape, required bool mBorderOnForeground, required Clip mClipBehavior}) → Material -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
offstageWidget(
Widget current) → Widget -
paddingWidget(
Widget current) → Widget -
refreshedWidget(
List< Widget> slivers) → Widget -
singleChildScrollViewWidget(
Widget current) → Widget -
stackWidget(
List< Widget> children) → Widget -
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
-
visibilityWidget(
Widget current) → Widget -
wrapWidget(
List< Widget> children) → Widget
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited