浏览代码

fix a part

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
d96f9965
共有 3 个文件被更改,包括 79 次插入59 次删除
  1. 6
      com.unity.uiwidgets/Runtime/cupertino/picker.cs
  2. 60
      com.unity.uiwidgets/Runtime/cupertino/route.cs
  3. 72
      com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs

6
com.unity.uiwidgets/Runtime/cupertino/picker.cs


child: ListWheelScrollView.useDelegate(
controller: widget.scrollController ?? _controller,
physics: new FixedExtentScrollPhysics(),
diameterRatio: (float)widget.diameterRatio,
diameterRatio: widget.diameterRatio ?? CupertinoPickerUtils._kDefaultDiameterRatio,
itemExtent: (float)widget.itemExtent,
squeeze: (float)widget.squeeze,
itemExtent: widget.itemExtent ?? 1f,
squeeze: widget.squeeze ?? CupertinoPickerUtils._kSqueeze,
onSelectedItemChanged: _handleSelectedItemChanged,
childDelegate: widget.childDelegate
)

60
com.unity.uiwidgets/Runtime/cupertino/route.cs


Animation<float> animation,
Animation<float> secondaryAnimation,
Widget child) {
CurvedAnimation fadeAnimation = new CurvedAnimation(
parent: animation,
curve: Curves.easeInOut

barrierColor: CupertinoDynamicColor.resolve(_kModalBarrierColor, context),
transitionDuration: TimeSpan.FromMilliseconds(250),
pageBuilder: (BuildContext context1, Animation<float> animation, Animation<float> secondaryAnimation)=> {
return builder(context1);
},
transitionBuilder: _buildCupertinoDialogTransitions,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings
);
return builder(context1);
},
transitionBuilder: _buildCupertinoDialogTransitions,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings
);
}
}

string title = "",
bool maintainState = true,
bool fullscreenDialog = false
) :
base(settings: settings, fullscreenDialog: fullscreenDialog) {
) : base(settings: settings, fullscreenDialog: fullscreenDialog) {
D.assert(builder != null);
D.assert(opaque);
this.builder = builder;

public override bool maintainState { get; }
public override TimeSpan transitionDuration {
get { return new TimeSpan(0, 0, 0, 0, 400); }
get { return TimeSpan.FromMilliseconds(400); }
}
public override Color barrierColor {

get { return null; }
}
/*public override bool canTransitionFrom(TransitionRoute<object> previousRoute) {
return previousRoute is CupertinoPageRoute<object>;
}*/
/*public override bool canTransitionTo(TransitionRoute<object> nextRoute) {
return nextRoute is CupertinoPageRoute<object> && !((CupertinoPageRoute<object>) nextRoute).fullscreenDialog;
}*/
public override bool canTransitionTo(TransitionRoute nextRoute) {
return nextRoute is CupertinoPageRoute && !((CupertinoPageRoute) nextRoute).fullscreenDialog;
}
static bool isPopGestureInProgress(PageRoute route) {
return route.navigator.userGestureInProgress;

}
public override Widget buildPage(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) {
public override Widget buildPage(BuildContext context, Animation<float> animation, Animation<float> secondaryAnimation) {
D.assert(() => {
D.assert(() =>{
throw new UIWidgetsError(
$"The builder for route {settings.name} returned null.\nRoute builders must never return null.");
throw new UIWidgetsError(new List<DiagnosticsNode>{
new ErrorSummary($"The builder for route \"{settings.name}\" returned null."),
new ErrorDescription("Route builders must never return null."),
});
return true;
});
return result;

bool linearTransition = isPopGestureInProgress(route);
if (route.fullscreenDialog) {
return new CupertinoFullscreenDialogTransition(
//animation: animation,
//child: child
primaryRouteAnimation: animation,
secondaryRouteAnimation: secondaryAnimation,
child: child,

class CupertinoPageTransition : StatelessWidget {
public CupertinoPageTransition(
Animation<float> primaryRouteAnimation,
Animation<float> secondaryRouteAnimation,
Widget child,
Animation<float> primaryRouteAnimation = null,
Animation<float> secondaryRouteAnimation = null,
Widget child = null,
Key key = null
) : base(key: key) {
_primaryPositionAnimation =

Animation<float> primaryRouteAnimation = null,
Animation<float> secondaryRouteAnimation = null,
Widget child = null,
bool linearTransition =false
bool linearTransition = false
) : base(key: key) {
_positionAnimation = new CurvedAnimation(

_CupertinoBackGestureController _backGestureController;
HorizontalDragGestureRecognizer _recognizer;
public override void initState() {
base.initState();
_recognizer = new HorizontalDragGestureRecognizer(debugOwner: this);

void _handleDragEnd(DragEndDetails details) {
D.assert(mounted);
D.assert(_backGestureController != null);
_backGestureController.dragEnd(
_convertToLogical(details.velocity.pixelsPerSecond.dx / context.size.width) ?? 0);
_backGestureController.dragEnd(_convertToLogical(details.velocity.pixelsPerSecond.dx / context.size.width) ?? 0);
_backGestureController = null;
}

animateForward = velocity <= 0;
}
else {
animateForward = controller.value > 0.5;
animateForward = controller.value > 0.5f;
}
if (animateForward) {
int droppedPageForwardAnimationTime = Mathf.Min(

72
com.unity.uiwidgets/Runtime/cupertino/scrollbar.cs


public const float _kScrollbarMinLength = 36.0f;
public const float _kScrollbarMinOverscrollLength = 8.0f;
public static readonly TimeSpan _kScrollbarTimeToFade = TimeSpan.FromMilliseconds(50);
public static readonly TimeSpan _kScrollbarTimeToFade = TimeSpan.FromMilliseconds(1200);
public static readonly TimeSpan _kScrollbarFadeDuration = TimeSpan.FromMilliseconds(250);
public static readonly TimeSpan _kScrollbarResizeDuration = TimeSpan.FromMilliseconds(100);

_painter.updateThickness(_thickness, _radius);
});
}
public override void didChangeDependencies() {
base.didChangeDependencies();
if (_painter == null) {
_painter = _buildCupertinoScrollbarPainter(context);
} else {
_painter.textDirection = Directionality.of(context);
_painter.color = CupertinoDynamicColor.resolve(CupertinoScrollbarUtils._kScrollbarColor, context);
_painter.padding = MediaQuery.of(context).padding;
}
WidgetsBinding.instance.addPostFrameCallback((TimeSpan duration)=> {
if (widget.isAlwaysShown) {
D.assert(widget.controller != null);
widget.controller.position.didUpdateScrollPositionBy(0);
}
});
}
public override void didUpdateWidget(StatefulWidget oldWidget) {
oldWidget = (CupertinoScrollbar) oldWidget;
base.didUpdateWidget(oldWidget);
if (widget.isAlwaysShown != ((CupertinoScrollbar)oldWidget).isAlwaysShown) {
if (widget.isAlwaysShown == true) {
D.assert(widget.controller != null);
_fadeoutAnimationController.animateTo(1.0f);
} else {
_fadeoutAnimationController.reverse();
}
}
}
public ScrollbarPainter _buildCupertinoScrollbarPainter(BuildContext context) {

return;
}
_handleDragScrollEnd(details.velocity.pixelsPerSecond.dy);
/*if (details.velocity.pixelsPerSecond.dy.abs() < 10 &&
if (details.velocity.pixelsPerSecond.dy.abs() < 10 &&
}*/
}
_currentController = null;
}

if (notification is ScrollUpdateNotification ||
notification is OverscrollNotification) {
// Any movements always makes the scrollbar start showing up.
if (_fadeoutAnimationController.status != AnimationStatus.forward) {
_fadeoutAnimationController.forward();
}
_fadeoutTimer?.cancel();
_painter.update(notification.metrics, notification.metrics.axisDirection);
if (_fadeoutAnimationController.status != AnimationStatus.forward) {
_fadeoutAnimationController.forward();
}
_fadeoutTimer?.cancel();
_painter.update(notification.metrics, notification.metrics.axisDirection);
// On iOS, the scrollbar can only go away once the user lifted the finger.
if (_dragScrollbarPositionY == null) {
_startFadeoutTimer();
}
if (_dragScrollbarPositionY == null) {
_startFadeoutTimer();
}
}
return false;
}

}
}
public override void dispose() {
_fadeoutAnimationController.dispose();
_thicknessAnimationController.dispose();
_fadeoutTimer?.cancel();
_painter.dispose();
base.dispose();
}
ScrollbarPainter _buildCupertinoScrollbarPainter() {

public override void dispose() {
_fadeoutAnimationController.dispose();
_thicknessAnimationController.dispose();
_fadeoutTimer?.cancel();
_painter.dispose();
base.dispose();
}
public override Widget build(BuildContext context) {
return new NotificationListener<ScrollNotification>(

正在加载...
取消
保存