Search code examples
flutterflutter-desktopflutter-windowsflutter-macos-2.0.0-stable

how to change title bar icon in flutter desktop


this is how I change the title but can't change the icon.

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
    setWindowTitle('Title');
    // setWindowMinSize(const Size(20, 20));
    setWindowMaxSize(Size.infinite);
  }
  runApp(new MyApp());
}

Solution

  • To change the default Icon for a flutter desktop application, you have to replace

    • For Windows windows/runner/resources/app_icon.ico
    • For MacOS macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_*.png

    Note that there are tools that can generate the iconset for macos, for example this online tool.