Search code examples
androidflutter

How to set flutter app display name correctly


I am not sure what I did wrong when changing the app's name but here is what I did:

  1. List item
  2. I changed the app label in AndroidManifest.xml
  3. App's name for iOS didn't need any change so I left it as it is.

App's name changes correctly but when going into the multitask screen, the name changes to something else. That name is actually a name I used before for another application. What I do is upload the same app but personalized for different clients. I have a github branch for every client. This is the first time to upload each client's app so what I did is before creating a new project, I delete all files and folders except .git folder and then create the next client and so on. The app name that shows in the multitask screen is the first app's name. Why is this happening and how to fix it ??


Solution

  • Please verify with this code:

    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'App Name', // This is the app title that appears in the task switcher and device settings.
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: HomePage(),
        );
      }
    }
    

    This works for me.