Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter : Where is the title of Material App used?

Tags:

flutter

dart

The flutter app name is shown by the package name, the AppBar title is shown on the AppBar of the home page, so where does the title MaterialApp(title: 'Rectangle App',); is used in flutter projects.

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(),       ),     );   } } 
like image 720
Tushar Rai Avatar asked May 31 '18 00:05

Tushar Rai


People also ask

What is difference between scaffold and MaterialApp in Flutter?

MaterialApp is a widget that introduces a number of widgets Navigator, Theme that are required to build a material design app. Scaffold Widget is used under MaterialApp, it gives you many basic functionalities, like AppBar, BottomNavigationBar, Drawer, FloatingActionButton, etc.

What is the difference between material and MaterialApp in Flutter?

MaterialApp is a widget that introduces many interesting tools such as Navigator or Theme to help you develop your app. Material is, on the other hand, a widget used to define a UI element respecting Material rules. It defines what elevation is, shape, and stuff.

What is home in material app Flutter?

home: This property takes in widget as the object to show on the default route of the app. initialRoute: This property takes in a string as the object to give the name of the first route in which the navigator is built. locale: It provides a locale for the MaterialApp.

What is the difference between WidgetsApp and MaterialApp?

What is the difference between WidgetsApp and MaterialApp ? WidgetsApp provides basic navigation. Together with the widgets library, it includes many of the foundational widgets that Flutter uses. MaterialApp and the corresponding material library is a layer built on top of WidgetsApp and the widgets library.


1 Answers

This is a good question. Below is the the explanation of how it is used:

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.

So in short:

  • On Android: it is used in Recent apps

  • On iOS: it is used in App switcher

Update 11th Feb, 2020:

The document is updated (I don't know exactly the updated time)

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].

So this value has no effect on iOS

like image 158
Phuc Tran Avatar answered Sep 26 '22 01:09

Phuc Tran