没有AppBar的Flutter应用程序设计 [英] Flutter application design without AppBar
问题描述
我尝试使用这种方法将我的所有UI(这里只有 Text
)存储在下面状态栏,但没有 AppBar :
import 'package:flutter / material.dart';
void main()=> runApp(MaterialApp(
title: example,
主页:Scaffold(
body:Text( text widget),
),
));
这个问题已经被提出,与我的文字类似,但是
但我想看到以下内容:
现在要弄清楚我的问题和另一个问题的区别:我不是在寻找保证金,我正在寻找一种合法的惯用方式。我的意思可能是这样的:
ScaffoldWithoutAppBar(body:...
显然这不存在,但我不希望保证金修正。
将页面内容(文本或脚手架)包装在 I tried using this kind of approach to have all of my UI (here only a This question was already asked once similar to my text, but the answer to it (which is also accepted) only takes My code gives me the following result: But I want to see this: Now to make the differenciation between my question and the other question clear: I am not searching for a margin, I am searching for a legitimate idiomatic way of doing this. What I mean with this might look like this: Obviously this does not exist, but I do not want a margin fix. Wrap your page content (Text or Scaffold) inside a SafeArea widget A widget that insets its child by sufficient padding to avoid intrusions by the operating system.
这篇关于没有AppBar的Flutter应用程序设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
返回新的SafeArea(child:new Text('text widget') );
Text
) in the application below the status bar, but without AppBar:import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
title: "example",
home: Scaffold(
body: Text("text widget"),
),
));
margin
into account. This, to me, does not seem like a satisfying solution, especially because you need to access MediaQuery.of(context).padding
, where I could not even figure out how to use context
in my simple example.ScaffoldWithoutAppBar(body: ...
return new SafeArea(child: new Text('text widget'));