title: How to make a Flutter DecoratedBox background image fill the viewport
body: <p>I'm trying to load a background image using DecoratedBox and show a small centred icon within it (I'm new to Flutter) - how do I force the background to scale to the screen width? </p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>class MainScreen extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        backgroundColor: Colors.black,
        body: Center(
          child: DecoratedBox(
            position: DecorationPosition.background,
            decoration: BoxDecoration(
              color: Colors.black,
              image: DecorationImage(
                  image: AssetImage('images/background.jpg'),
                  fit: BoxFit.fill),
            ),
            child: GestureDetector(
              onTap: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (context) =&gt; MenuScreen(),
                  ),
                );
              },
              child: Image(
                height: 100.0,
                width: 100.0,
                image: AssetImage('images/centre.png'),
              ),
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>I understand the container scales to the contents - would I need to sit the icon inside another full-width element?</p>
  
  <p>Cheers</p>