Flutter 有没有办法在“颤振”中创建动画圆弧?
你好,我想做这样的 有没有办法让它飞起来 我正在使用Flutter 有没有办法在“颤振”中创建动画圆弧?,flutter,Flutter,你好,我想做这样的 有没有办法让它飞起来 我正在使用 Container( padding:EdgeInsets.all(20), alignment:Alignment.center, height:300, child: Container(
Container(
padding:EdgeInsets.all(20),
alignment:Alignment.center,
height:300,
child:
Container(
decoration: DottedDecoration(
shape: Shape.circle,
dash: <int>[1, 4],
color: Colors.blue,
strokeWidth: 2
),
height:animation.value,
width: animation.value,
),
),
容器(
填充:边缘设置。全部(20),
对齐:对齐.center,
身高:300,
儿童:
容器(
装饰:点装饰(
shape:shape.circle,
破折号:[1,4],
颜色:颜色,蓝色,
冲程宽度:2
),
高度:animation.value,
宽度:animation.value,
),
),
您应该使用AnimationController()
下面是示例中的grow过渡
class GrowTransition extends StatelessWidget {
GrowTransition({required this.child, required this.animation});
final Widget child;
final Animation<double> animation;
Widget build(BuildContext context) => Center(
child: AnimatedBuilder(
animation: animation,
builder: (context, child) => Container(
height: animation.value,
width: animation.value,
child: child,
),
child: child),
);
}
class-growtransformation扩展了无状态小部件{
GrowtTransition({需要this.child,需要this.animation});
最后一个孩子;
最终动画;
小部件构建(构建上下文)=>Center(
子对象:动画生成器(
动画:动画,
生成器:(上下文,子项)=>容器(
高度:animation.value,
宽度:animation.value,
孩子:孩子,
),
儿童:儿童),,
);
}