How to change app icon and app name for Flutter Desktop application?

Viewed 4860

I'm using Flutter to develop Windows desktop application, but don't know how to change the name and icon for the application.

2 Answers

I think I've found the solution. The following should work for Windows application:

To change application icon: Simply put icon file under windows/runner/resources folder, and change the IDI_APP_ICON part in windows\runner\Runner.rc file to your icon file name.

To change application name: Open windows/runner/main.cpp file, and change your application name inside window.CreateAndShow function.

add this in your void main()

void main() {
WidgetsFlutterBinding.ensureInitialized();
  if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
    setWindowTitle('title here');
  }
  runApp(new MyApp());
}

Include this dependency in pubspec.yaml for this to work:

window_size:
    git:
      url: git://github.com/google/flutter-desktop-embedding.git
      path: plugins/window_size
      ref: 7812516a5c1fc8ef379e244106953a2b534432b9
Related