Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter desktop - change window title from Dart code

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

like image 831
user1209216 Avatar asked Dec 22 '22 17:12

user1209216


2 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

like image 134
tomrozb Avatar answered Jan 21 '23 15:01

tomrozb


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

like image 45
Dika Desandra Ardiansyah Avatar answered Jan 21 '23 14:01

Dika Desandra Ardiansyah