设置背景图片

body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage("image/loginbg.png"),
            fit: BoxFit.cover,
          ),
        ),
        child: Center(
          child: Text('Hello Wolrd', style: TextStyle(fontSize: 22.0, color: Colors.red),),
        ),
      )

你可能感兴趣的:(设置背景图片)