Google Flutter的rotationX视角
Google Flutter's rotationX perspective
我是 Google Flutter 的新手。作为 Web 开发人员,我曾经与 CSS 一起工作。这是我想在 Google Flutter 中实现的 fiddle:
https://jsfiddle.net/u2p5dzmc/
这是我到目前为止创建的内容:
...
Widget _buildAnimation(BuildContext context, Widget child) {
return new Container(
padding: padding.value,
child: new Container(
alignment: Alignment.center,
transform: new Matrix4.identity()..rotateY(-45.0),
width: width.value,
height: height.value,
child: new Image.asset('assets/images/kitten.jpg'),
decoration: new BoxDecoration(
border: new Border.all(
width: 3.0,
),
borderRadius: borderRadius.value,
),
),
);
}
...
我设法旋转了小部件,但不知道如何像在 CSS 中那样设置视角。
有什么想法吗?
谢谢。
经过深入挖掘,在Flutter官网上找到了答案:https://flutter.io/faq/
我可以使用 Flutter 构建 3D (OpenGL) 应用程序吗?
目前我们不支持通过 OpenGL ES 或类似的 3D。我们有公开优化 3D 的长期计划 API,但现在我们专注于 2D。
更新
GoogleFlutterhere中有一篇文章讲的是Perspective。
我是 Google Flutter 的新手。作为 Web 开发人员,我曾经与 CSS 一起工作。这是我想在 Google Flutter 中实现的 fiddle:
https://jsfiddle.net/u2p5dzmc/
这是我到目前为止创建的内容:
...
Widget _buildAnimation(BuildContext context, Widget child) {
return new Container(
padding: padding.value,
child: new Container(
alignment: Alignment.center,
transform: new Matrix4.identity()..rotateY(-45.0),
width: width.value,
height: height.value,
child: new Image.asset('assets/images/kitten.jpg'),
decoration: new BoxDecoration(
border: new Border.all(
width: 3.0,
),
borderRadius: borderRadius.value,
),
),
);
}
...
我设法旋转了小部件,但不知道如何像在 CSS 中那样设置视角。
有什么想法吗?
谢谢。
经过深入挖掘,在Flutter官网上找到了答案:https://flutter.io/faq/
我可以使用 Flutter 构建 3D (OpenGL) 应用程序吗?
目前我们不支持通过 OpenGL ES 或类似的 3D。我们有公开优化 3D 的长期计划 API,但现在我们专注于 2D。
更新
GoogleFlutterhere中有一篇文章讲的是Perspective。