【问题标题】:MaterialApp Widget's title Property Not WorkingMaterialApp 小部件的标题属性不起作用
【发布时间】:2020-02-28 17:24:57
【问题描述】:

我是 Flutter 的绝对初学者!

图片#1:参考教程。

图片#2:我的实现。

虚拟设备:Nexus_5X_API_28 安卓:9.0

【问题讨论】:

    标签: android flutter dart visual-studio-code avd


    【解决方案1】:

    您确定在两个示例中使用的是同一个模拟器吗? MaterialApp Widget 中的标题不是您将在应用程序栏中看到的标题。

    设备用于识别应用程序

    如文档所述。

    所以也许这就是设备显示“正在运行的应用程序菜单”的方式。


    如果要显示appBar需要使用Scaffold

    void main() => runApp(
          MaterialApp(
            title: 'App',
            home: Scaffold(
              appBar: AppBar(
                title: Text('My App'),
              ),
              body: Center(
                child: Text("text"),
              ),
            ),
          ),
        );
    

    【讨论】:

    猜你喜欢
    • 2021-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多