uWrap function
Widget
uWrap(
- Widget child, {
- BorderRadius? borderRadius,
- double? radius,
- GestureTapCallback? onTap,
- VoidCallback? onPress,
- GestureTapCallback? onDoubleTap,
- GestureLongPressCallback? onLongPress,
- GestureTapDownCallback? onTapDown,
- GestureTapUpCallback? onTapUp,
- GestureTapCancelCallback? onTapCancel,
- GestureTapCallback? onSecondaryTap,
- HitTestBehavior? hitTestBehavior,
- bool splash = false,
- Color? splashColor,
- Color? highlightColor,
- Color? hoverColor,
- double? pressedScale,
- Duration pressDuration = const Duration(milliseconds: 120),
- bool enableFeedback = true,
- MouseCursor? cursor,
- ValueChanged<
bool> ? onHover, - double? opacity,
- String? tooltip,
- String? heroTag,
- EdgeInsetsGeometry? margin,
- String? semanticsLabel,
- bool? semanticsButton,
- bool visible = true,
- BoxFit? fit,
- AlignmentGeometry fitAlignment = Alignment.center,
- double? scale,
- double? rotate,
- Offset? translate,
- bool center = false,
- bool safeArea = false,
- Axis? scrollable,
- ScrollController? scrollController,
- TextDirection? textDirection,
- int? expanded,
- int? flexible,
- bool positioned = false,
- double? left,
- double? top,
- double? right,
- double? bottom,
- double? positionedWidth,
- double? positionedHeight,
Implementation
Widget uWrap(
Widget child, {
BorderRadius? borderRadius,
double? radius,
GestureTapCallback? onTap,
VoidCallback? onPress,
GestureTapCallback? onDoubleTap,
GestureLongPressCallback? onLongPress,
GestureTapDownCallback? onTapDown,
GestureTapUpCallback? onTapUp,
GestureTapCancelCallback? onTapCancel,
GestureTapCallback? onSecondaryTap,
HitTestBehavior? hitTestBehavior,
bool splash = false,
Color? splashColor,
Color? highlightColor,
Color? hoverColor,
double? pressedScale,
Duration pressDuration = const Duration(milliseconds: 120),
bool enableFeedback = true,
MouseCursor? cursor,
ValueChanged<bool>? onHover,
double? opacity,
String? tooltip,
String? heroTag,
EdgeInsetsGeometry? margin,
String? semanticsLabel,
bool? semanticsButton,
bool visible = true,
BoxFit? fit,
AlignmentGeometry fitAlignment = Alignment.center,
double? scale,
double? rotate,
Offset? translate,
bool center = false,
bool safeArea = false,
Axis? scrollable,
ScrollController? scrollController,
TextDirection? textDirection,
int? expanded,
int? flexible,
bool positioned = false,
double? left,
double? top,
double? right,
double? bottom,
double? positionedWidth,
double? positionedHeight,
}) {
if (!visible) return const SizedBox.shrink();
final GestureTapCallback? effectiveTap = onTap ?? onPress;
final double? effectivePressedScale = pressedScale ?? (onPress != null ? 0.9 : null);
Widget current = _uInteractive(
child,
radius: _uRadius(borderRadius, radius),
onTap: effectiveTap,
onDoubleTap: onDoubleTap,
onLongPress: onLongPress,
onTapDown: onTapDown,
onTapUp: onTapUp,
onTapCancel: onTapCancel,
onSecondaryTap: onSecondaryTap,
hitTestBehavior: hitTestBehavior,
splash: splash,
splashColor: splashColor,
highlightColor: highlightColor,
hoverColor: hoverColor,
pressedScale: effectivePressedScale,
pressDuration: pressDuration,
enableFeedback: enableFeedback,
cursor: cursor,
onHover: onHover,
);
current = _uEffects(current, opacity: opacity, tooltip: tooltip, heroTag: heroTag, margin: margin, semanticsLabel: semanticsLabel, semanticsButton: semanticsButton);
current = _uModifiers(
current,
fit: fit,
fitAlignment: fitAlignment,
scale: scale,
rotate: rotate,
translate: translate,
center: center,
safeArea: safeArea,
scrollable: scrollable,
scrollController: scrollController,
textDirection: textDirection,
expanded: expanded,
flexible: flexible,
positioned: positioned,
left: left,
top: top,
right: right,
bottom: bottom,
positionedWidth: positionedWidth,
positionedHeight: positionedHeight,
);
return current;
}