dart - flutter : Where is the title of Material Ap

flutter 应用名称包名显示,AppBar标题显示在首页的AppBar ,那么标题MaterialApp(title: 'Rectangle App',);在哪里用在flutter项目中。

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Rectangle App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Rectangle App Home Page'),
        ),
        body: HelloRectangle(),
      ),
    );
  }
}

最佳答案

这是个好问题。下面是它的使用说明:

A one-line description used by the device to identify the app for the user.

On Android the titles appear above the task manager's app snapshots which are displayed when the user presses the "recent apps" button. Similarly, on iOS the titles appear in the App Switcher when the user double presses the home button.

简而言之:

  • 在 Android 上:用于最近的应用程序

  • iOS:应用切换器中使用

2020 年 2 月 11 日更新:

文档更新了(具体更新时间我不知道)

A one-line description used by the device to identify the app for the user. On Android the titles appear above the task manager's app snapshots which are displayed when the user presses the "recent apps" button. On iOS this value cannot be used. CFBundleDisplayName from the app's Info.plist is referred to instead whenever present, CFBundleName otherwise. To provide a localized title instead, use [onGenerateTitle].

所以这个值对iOS没有影响

关于dart - flutter : Where is the title of Material App used?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50615006/

相关文章:

flutter - 如何在 Flutter 中创建 GridView 布局

android - 如何在 flutter 中制作不透明的教程屏幕?

flutter - 点击 AppBar 打开抽屉

flutter - 在 Flutter 中更改 TextField 的下划线

android - 使用 Flutter 的 Android Studio 中不显示设备列表

dart - 如何在 Flutter 中隐藏 TextField 底部的字母计数器

dart - 为什么 setState 会关闭?

flutter - 垂直视口(viewport)被赋予了无限的高度

dart - 带有快速拨号的 flutter float Action 按钮

flutter - 在 Flutter 中显示用户友好的错误页面而不是异常