3

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());
}

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

2

Title is plateform dependant. for Window have a look in main.cpp

  FlutterWindow window(&run_loop, project);
  Win32Window::Point origin(10, 10);
  Win32Window::Size size(1280, 720);
  if (!window.CreateAndShow(L"Your title", origin, size)) {
    return EXIT_FAILURE;
  }

Title is hard coded !


1 Comment

I want to change the icon, not the title. can u tell me how can I change icon in the title bar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.