Skip to content

Commit

Permalink
windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
onatcipli committed Sep 23, 2023
1 parent c173219 commit 147558e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/platform_file_editors/windows_platform_file_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class WindowsPlatformFileEditor extends AbstractPlatformFileEditor {
filePath: filePath,
);
for (var i = 0; i < contentLineByLine.length; i++) {
if (contentLineByLine[i]?.contains('window.Create') ?? false) {
if (contentLineByLine[i]?.contains('window.CreateAndShow') ?? false) {
var match = RegExp(r'CreateAndShow\(L"(.*?)"')
.firstMatch(contentLineByLine[i]!);
return match?.group(1)?.trim();
} else if (contentLineByLine[i]?.contains('window.Create') ?? false) {
var match =
RegExp(r'Create\(L"(.*?)"').firstMatch(contentLineByLine[i]!);
return match?.group(1)?.trim();
Expand Down Expand Up @@ -77,7 +81,13 @@ class WindowsPlatformFileEditor extends AbstractPlatformFileEditor {
filePath: filePath,
);
for (var i = 0; i < contentLineByLine.length; i++) {
if (contentLineByLine[i].contains('window.Create')) {
if (contentLineByLine[i].contains('window.CreateAndShow')) {
contentLineByLine[i] = contentLineByLine[i]
.replaceAllMapped(RegExp(r'CreateAndShow\(L"(.*?)"'), (match) {
return 'Create(L"$appName"';
});
break;
} else if (contentLineByLine[i].contains('window.Create')) {
contentLineByLine[i] = contentLineByLine[i]
.replaceAllMapped(RegExp(r'Create\(L"(.*?)"'), (match) {
return 'Create(L"$appName"';
Expand Down

0 comments on commit 147558e

Please sign in to comment.