Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 如何在颤振中实现图像背景_Image_Flutter_Background - Fatal编程技术网

Image 如何在颤振中实现图像背景

Image 如何在颤振中实现图像背景,image,flutter,background,Image,Flutter,Background,我想有一个背景图像,但不知道如何实现它,我写下了代码的第一部分,我认为这是解决问题所需要的 我需要Dart(颤振)中的解决方案。我用装饰盒尝试了一些东西,但没有成功,希望有人能帮助我 @override Widget build(BuildContext context) { return SafeArea( child: Scaffold( // appBar: AppBar(title: Text('App',style: TextStyle(fon

我想有一个
背景图像
,但不知道如何实现它,我写下了代码的第一部分,我认为这是解决问题所需要的

我需要Dart(颤振)中的解决方案。我用
装饰盒尝试了一些东西,但没有成功,希望有人能帮助我

 @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        // appBar: AppBar(title: Text('App',style: TextStyle(fontWeight: FontWeight.w900),),backgroundColor: Colors.brown[500],),
        body: Center(
          child: Padding(
试试这个:

  @override
  Widget build(BuildContext context){
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            image: NetworkImage(''),
            fit: BoxFit.cover,
          ),
        ),
        child: Container(),
      ),
    );
  }
试试这个:

  @override
  Widget build(BuildContext context){
    return Scaffold(
      body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            image: NetworkImage(''),
            fit: BoxFit.cover,
          ),
        ),
        child: Container(),
      ),
    );
  }