如何更改原始代码以在我的SafeArea小部件中始终添加`top:false'?
我想使用“ statusbarcolor:colors.thransparent”,在所有视图上,我都可以使用themedata来执行此操作,我必须使用Safearea(top:false),是的,是的,这是一个解决方案,但我必须使用safearea( top:false)在所有视图上,
Widget build(BuildContext context) {
return SafeArea(
top: false,
.........
我找不到任何使用themedata的解决方案,所以我要么要去要在我拥有的所有视图上使用它,或者我将更改原始代码(safe_area.dart)。如果这样做,这就是我想要的,这完全适合我的情况。
I wanted to use "statusBarColor: Colors.transparent", on all views, I can do this with ThemeData besides, I have to use SafeArea(top: false,) like this, yeah this is a solution but I have to use SafeArea(top: false) on all view,
Widget build(BuildContext context) {
return SafeArea(
top: false,
.........
I didn't find any solution with ThemeData, so I was either going to use it on all views I have or I was going to change the original code(safe_area.dart). If I do, this is what I want and this fits perfectly in my situation.
question => to change original code is bad idea ? or good idea ? in what case should we do this, or should we do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
始终添加
top:false
每当您调用safearea()
,您可以创建自己的类,
扩展
safearea
:然后调用
mySafeArea()
而不是safearea()
To always add
top: false
whenever you call aSafeArea()
,you can create your own class that
extends
SafeArea
:Then call
mySafeArea()
instead ofSafeArea()