class _HomePageState extends State<HomePage>{
@override
Widget build(BuildContext context) {
// 获取屏幕宽高
final size = MediaQuery.of(context).size;
final width = size.width;
final height = size.height;

return Container(
width: width,
height: height,
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage('https://m.airchina.com.cn:9062/fu/yx/20200804/5bcecdbba76d41f19d5913aa7684469a.jpg'),
fit: BoxFit.cover,
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.transparent,
),
body: Container(
width: width,
child: Text('hello'),
),
),
);
}
}

相关文章:

  • 2021-08-30
  • 2021-11-30
  • 2022-02-09
  • 2022-12-23
  • 2021-06-26
  • 2021-10-19
  • 2021-04-08
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-08-13
相关资源
相似解决方案