flutter - 如何在 Flutter 创建的应用程序中隐藏 AppBar

标签 flutter

<分区>

我下面有这段代码,我想隐藏酒吧应用程序,可以吗?我已经尝试直接通过 Android 主题,但没有成功。 :(

  @override
  Widget build(BuildContext context) {
    return WebviewScaffold(
      appBar: AppBar(
        title: TextField(
          autofocus: false,
          controller: controller,
          textInputAction: TextInputAction.go,
          onSubmitted: (url) => launchUrl(),
          style: TextStyle(color: Colors.white),
          decoration: InputDecoration(
            border: InputBorder.none,
            hintText: "Digite a URL",
            hintStyle: TextStyle(color: Colors.white),
          ),
        ),
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.navigate_next),
            onPressed: () => launchUrl(),
          )
        ],
      ),

最佳答案

要隐藏 appBar,只需在任何屏幕中将 appBar 属性设置为 null。此更改将反射(reflect)在 IOS 和 Android 中。 :)

  Widget build(BuildContext context) {
    return WebviewScaffold(
       url: "https://flutter.dev/",                    // Your url
       appBar: null                                    // No action bar will build
       );
    }

关于flutter - 如何在 Flutter 创建的应用程序中隐藏 AppBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54486349/

相关文章:

dart - 所有小部件上的 Flutter 工具提示

flutter : Why can't I move the cursor in the TextField to the beginning of the text?

flutter - 有没有什么方法可以在不使用 Material 小部件的情况下提升小部件的 flutter ?

dart - 在 flutter 中解析嵌套的 JSON 列表时出错

dart - Flutter/Dart 引用函数与使用 Widget 内联执行

listview - 如何将点击传递给顶部小部件下方的小部件?

flutter : Achieved Sliverappbar Shape

intellij-idea - 设置VM标志失败

android-studio - Flutter 如何在 Android Studio 中制作发布版本?

sqlite - 使用 SQFlite (Flutter) 的一对多关系