答案 0 :(得分:3)
您可以在resizeToAvoidBottomPadding
false
设置为Scaffold
Scaffold(
resizeToAvoidBottomPadding: false,
appBar: new AppBar(),
);
答案 1 :(得分:0)
我使用了resizeToAvoidBottomPadding = false,但有时导航栏所在的位置有白色填充。不一致,有时会显示出来,有时却不显示
答案 2 :(得分:0)
这段代码对我有用,谢谢
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([]);
return Scaffold(
resizeToAvoidBottomPadding: false
)
}
答案 3 :(得分:-2)
使用SystemChrome.setEnabledSystemUIOverlays([]);在您的小部件中,它将可以完美工作:
@override
Widget build(BuildContext context) {
// To make this screen full screen.
// It will hide status bar and notch.
SystemChrome.setEnabledSystemUIOverlays([]);
// full screen image for splash screen.
return Container(
child: new Image.asset('assets/splash.png', fit: BoxFit.fill));
}
}
并记得导入
import 'package:flutter/services.dart';