看起来您只需要移动背景图像就可以成为父窗口小部件。即
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: ExactAssetImage('assets/images/bg.png'),
fit: BoxFit.fill,
alignment:Alignment.topCenter,
),
),
child: Stack(
children: <Widget>[
Container(
child: SingleChildScrollView(
padding: EdgeInsets.all(width * 0.10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
height: height * 0.10,
),
Container(
decoration: BoxDecoration(color: Colors.transparent),
child: Container(
margin: EdgeInsets.only(
bottom: height * 0.02, left: 20.0, right: 20.0),
child: Image.asset('assets/images/logo.png'),
),
),
SizedBox(
height: height * 0.05,
),
Container(
decoration:
BoxDecoration(color: Colors.transparent),
child: Container()
new Form(
key: _formKey,
autovalidate: _autoValidate,
child: LoginFrom(width, height))
),
],
),
),
),
],
)) // This trailing comma makes auto-formatting nicer for build methods.
);