浏览代码

fix some errors

/zgh-devtools
guanghuispark 4 年前
当前提交
b658d338
共有 4 个文件被更改,包括 70 次插入25 次删除
  1. 4
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs
  2. 6
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/backdrop.cs
  3. 83
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs
  4. 2
      Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/login.cs

4
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/cupertino/cupertino_navigation_demo.cs


decoration: new BoxDecoration(
image: new DecorationImage(
image: new FileImage(
file: "logo.png"
file: "people/square/trevor.png"
)
),
shape: BoxShape.circle

decoration: new BoxDecoration(
image: new DecorationImage(
image: new FileImage(
"logo.png"
"people/square/sandra.png"
)
),
shape: BoxShape.circle

6
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/backdrop.cs


)
),
new FractionalTranslation(
translation: new Tween<Offset>(
translation: new OffsetTween(
begin: Offset.zero,
end: new Offset(1.0f, 0.0f)).evaluate(animation),
child: new Container(

curve: new Interval(0.5f, 1.0f)
).value,
child: new FractionalTranslation(
translation: new Tween<Offset>(
translation: new OffsetTween(
begin: Offset.zero,
end: new Offset(0.5f, 0.0f)).evaluate(animation),
child: backTitle

parent: animation,
curve: new Interval(0.5f, 1.0f)).value,
child: new FractionalTranslation(
translation: new Tween<Offset>(
translation: new OffsetTween(
begin: new Offset(-0.25f, 0.0f),
end: Offset.zero).evaluate(animation),
child: frontTitle

83
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/expanding_bottom_sheet.cs


public static readonly float _kCornerRadius = 24.0f;
public static readonly float _kWidthForCartIcon = 64.0f;
public static Animation<T> _getEmphasizedEasingAnimation<T>(
T begin,
T peak,
T end,
public static Animation<float> _getFloatEmphasizedEasingAnimation(
float begin,
float peak,
float end,
bool isForward,
Animation<float> parent
) {

secondWeight = _kPeakVelocityTime;
}
return new TweenSequence<T>(
new List<TweenSequenceItem<T>>{
new TweenSequenceItem<T>(
return new TweenSequence<float>(
new List<TweenSequenceItem<float>>{
new TweenSequenceItem<float>(
tween: new Tween<T>(
tween: new FloatTween(
new TweenSequenceItem<T>(
new TweenSequenceItem<float>(
tween: new Tween<T>(
tween: new FloatTween(
begin: peak,
end: end
).chain(new CurveTween(curve: secondCurve))

}
public static Animation<Offset> _getOffsetEmphasizedEasingAnimation(
Offset begin,
Offset peak,
Offset end,
bool isForward,
Animation<float> parent
) {
Curve firstCurve;
Curve secondCurve;
float firstWeight;
float secondWeight;
if (isForward) {
firstCurve = _kAccelerateCurve;
secondCurve = _kDecelerateCurve;
firstWeight = _kPeakVelocityTime;
secondWeight = 1.0f - _kPeakVelocityTime;
} else {
firstCurve = _kDecelerateCurve.flipped;
secondCurve = _kAccelerateCurve.flipped;
firstWeight = 1.0f - _kPeakVelocityTime;
secondWeight = _kPeakVelocityTime;
}
return new TweenSequence<Offset>(
new List<TweenSequenceItem<Offset>>{
new TweenSequenceItem<Offset>(
weight: firstWeight,
tween: new OffsetTween(
begin: begin,
end: peak
).chain(new CurveTween(curve: firstCurve))
),
new TweenSequenceItem<Offset>(
weight: secondWeight,
tween: new OffsetTween(
begin: peak,
end: end
).chain(new CurveTween(curve: secondCurve))
),
}
).animate(parent);
}
public static float _getPeakPoint(float begin, float end) {
return begin + (end - begin) * _kPeakVelocityProgress;
}

Animation<float> _getWidthAnimation(float screenWidth) {
if (_controller.status == AnimationStatus.forward) {
return new Tween<float>(begin: _width, end: screenWidth).animate(
return new FloatTween(begin: _width, end: screenWidth).animate(
new CurvedAnimation(
parent: _controller.view,
curve: new Interval(0.0f, 0.3f, curve: Curves.fastOutSlowIn)

return expanding_buttom_sheetUtils._getEmphasizedEasingAnimation(
return expanding_buttom_sheetUtils._getFloatEmphasizedEasingAnimation(
begin: _width,
peak: expanding_buttom_sheetUtils._getPeakPoint(begin: _width, end: screenWidth),
end: screenWidth,

Animation<float> _getHeightAnimation(float screenHeight) {
if (_controller.status == AnimationStatus.forward) {
return expanding_buttom_sheetUtils._getEmphasizedEasingAnimation(
return expanding_buttom_sheetUtils._getFloatEmphasizedEasingAnimation(
begin: expanding_buttom_sheetUtils._kCartHeight,
peak: expanding_buttom_sheetUtils._kCartHeight + (screenHeight - expanding_buttom_sheetUtils._kCartHeight) * expanding_buttom_sheetUtils._kPeakVelocityProgress,
end: screenHeight,

} else {
return new Tween<float>(
return new FloatTween(
begin: expanding_buttom_sheetUtils._kCartHeight,
end: screenHeight
).animate(

// Animation of the cut corner. It's cut when closed and not cut when open.
Animation<float> _getShapeAnimation() {
if (_controller.status == AnimationStatus.forward) {
return new Tween<float>(begin: expanding_buttom_sheetUtils._kCornerRadius, end: 0.0f).animate(
return new FloatTween(begin: expanding_buttom_sheetUtils._kCornerRadius, end: 0.0f).animate(
new CurvedAnimation(
parent: _controller.view,
curve: new Interval(0.0f, 0.3f, curve: Curves.fastOutSlowIn)

return expanding_buttom_sheetUtils._getEmphasizedEasingAnimation(
return expanding_buttom_sheetUtils._getFloatEmphasizedEasingAnimation(
begin: expanding_buttom_sheetUtils._kCornerRadius,
peak: expanding_buttom_sheetUtils._getPeakPoint(begin: expanding_buttom_sheetUtils._kCornerRadius, end: 0.0f),
end: 0.0f,

}
Animation<float> _getThumbnailOpacityAnimation() {
return new Tween<float>(begin: 1.0f, end: 0.0f).animate(
return new FloatTween(begin: 1.0f, end: 0.0f).animate(
new CurvedAnimation(
parent: _controller.view,
curve: _controller.status == AnimationStatus.forward

// Builder for the hide and reveal animation when the backdrop opens and closes
Widget _buildSlideAnimation(BuildContext context, Widget child) {
_slideAnimation = expanding_buttom_sheetUtils._getEmphasizedEasingAnimation(
_slideAnimation = expanding_buttom_sheetUtils._getOffsetEmphasizedEasingAnimation(
begin: new Offset(1.0f, 0.0f),
peak: new Offset(expanding_buttom_sheetUtils._kPeakVelocityProgress, 0.0f),
end: new Offset(0.0f, 0.0f),

}
Widget _buildThumbnail(BuildContext context, int index, Animation<float> animation) {
Animation<float> thumbnailSize = new Tween<float>(begin: 0.8f, end: 1.0f).animate(
Animation<float> thumbnailSize = new FloatTween(begin: 0.8f, end: 1.0f).animate(
new CurvedAnimation(
curve: new Interval(0.33f, 1.0f, curve: Curves.easeIn),
parent: animation

2
Samples/UIWidgetsSamples_2019_4/Assets/UIWidgetsGallery/demo/shrine/login.cs


new Column(
children: new List<Widget>
{
Image.asset("packages/shrine_images/diamond.png"),
Image.file("shrine_images/diamond.png"),
new SizedBox(height: 16.0f),
new Text(
"SHRINE",

正在加载...
取消
保存