背景图像与Youtube播放器到位



我有一个页面在我的扑动应用程序,我从youtube上播放视频。问题是,我想在整个页面上有一个背景图像但由于某些原因,图像没有出现。有没有人可以看看我的代码,告诉我我在这里做错了什么


@override
Widget build(BuildContext context) {
return YoutubePlayerBuilder(
player: YoutubePlayer(
controller: controller,
),
builder: (context, player) {
return Container(
constraints: const BoxConstraints.expand(),
decoration:  const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/9prosthetics-iStock1545696-copy2.png')
,  fit: BoxFit.fill),
),
child: Scaffold(
appBar:  AppBar(......

提前感谢

在scaffold中添加背景色

backgroundColor: Colors.transparent,

脚手架默认为白色背景

顺便说一句,在容器中添加支架内的图像并作为容器的子元素添加列并在列内添加播放器是很好的

最新更新