首页 > 解决方案 > 如何在 3D 视图中显示图像?

问题描述

我正在尝试在 3D 视图中实现相框,如下图所示,但无法像给定的图像那样实现。

在此处输入图像描述

代码:

class Photo3DView extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Card(
          elevation: 15,
          child: Container(
            height: 200,
            width: 200,
            decoration: BoxDecoration(
              border: Border.all(color:Colors.black, width: 10),
              image: DecorationImage(
                image: NetworkImage("https://wallpaperaccess.com/full/3957694.jpg"),
                 fit: BoxFit.cover
              )
            ),
          ),
        ),
      ),
    );
  }
}

输出:

在此处输入图像描述

结果

标签: dart3dflutter-layout

解决方案


推荐阅读