Flutter desktop - change window title from Dart code

Viewed 5146

I am unable to find any way to do that when searching official documentation. Does anybody know any way to do that?

3 Answers

It is possible, as mentioned in https://github.com/flutter/flutter/issues/30712

In pubspec.yaml add

dependencies:
  window_size:
    git:
      url: git://github.com/google/flutter-desktop-embedding.git
      path: plugins/window_size
      ref: fd519be1e8398c6b6c2062c2447bac960a71bc02

Now in your code just call

import 'package:window_size/window_size.dart';

setWindowTitle("Custom window title");

Works fine on Linux. Haven't tested on Windows/Mac

Go to windows > runner > main.cpp folder, find a " !window.CreateAndShow(L"schedule_task", origin, size) " And change the "schedule_task" text

Related