If you want it to show while loading the screen use the
index.html
method as answered before by Suragch
If you want it to show after the screen loads use the Material App
method as answered by 6thsage
If you want both, just use both
Below is the while loading screen method explained
There is a top level folder called web inside your project. Open the index.html file in that folder and you should see something similar to the following:
web/index.html
<!DOCTYPE HTML>
<HTML>
<head>
<meta charset="UTF-8">
<title>my_app_client</title>
</head>
<body>
<script src="main.dart.js" type="application/javascript">.
</script>
</body>
</html>
Change the title text to your app name:
Below is the after-loading screen method explained
My App
This will then show the correct title while the Flutter app is loading.
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title:'Your Title',
home: HomePage(),
theme: appTheme(),
);
}
}
MateralApp
:onGenerateTitle: (BuildContext context) => AppLocalizations.of(context)!.appTitle,
– Kalvin