Flutter 我如何制作一个可以无间隙翻译的全屏背景图像
这会创建一个可以随边距移动的全屏背景图像,但会在底部创建一条空白条Flutter 我如何制作一个可以无间隙翻译的全屏背景图像,flutter,Flutter,这会创建一个可以随边距移动的全屏背景图像,但会在底部创建一条空白条 Container( margin: EdgeInsets.only(bottom: 50), child: Container( decoration: BoxDecoration( color: snapshot.data.color, image: Decorati
Container(
margin: EdgeInsets.only(bottom: 50),
child: Container(
decoration: BoxDecoration(
color: snapshot.data.color,
image: DecorationImage(
image: AssetImage("assets/overlay.png"),
fit: BoxFit.cover,
),
),
),
),
如何创建比视口稍大的全屏背景图像,并能够在没有任何剪辑或间隙的情况下移动它?这是一个如何设置全屏背景图像的示例代码
return new Container(
child: new Stack(
children: <Widget>[
new Container(
decoration: BoxDecoration(
// color: snapshot.data.color,
image: DecorationImage(
// image: AssetImage("assets/overlay.png"),
image: NetworkImage('http://www.vactualpapers.com/web/images/April-28-2016/Glitters%20in%20the%20Air%20HD%20Mobile%20Wallpaper.jpg'),
fit: BoxFit.cover,
),
),
),
new Scaffold(
appBar: new AppBar(
title: new Text('Full Background img'),
backgroundColor: const Color(0xFF121F2B),
),
backgroundColor: Colors.transparent,
body: new Center(
child: new Text('Hello How are you?',
style: new TextStyle(fontSize: 20.0, color: Colors.white),),
),
)
],
),
);
返回新容器(
子:新堆栈(
儿童:[
新容器(
装饰:盒子装饰(
//颜色:snapshot.data.color,
图像:装饰图像(
//图片:AssetImage(“assets/overlay.png”),
图像:NetworkImage('http://www.vactualpapers.com/web/images/April-28-2016/Glitters%20in%20the%20Air%20HD%20Mobile%20Wallpaper.jpg'),
适合:BoxFit.cover,
),
),
),
新脚手架(
appBar:新的appBar(
标题:新文本(“完整背景img”),
背景颜色:常量颜色(0xFF121F2B),
),
背景颜色:颜色。透明,
正文:新中心(
孩子:新的文本(“你好吗?”,
样式:新的文本样式(fontSize:20.0,颜色:Colors.white),
),
)
],
),
);
“四处走动”?用动画?使用手势检测?请说得更具体些