Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Fixed
- Opening the iOS Simulator with Xcode 27, which replaced `Simulator.app` with `DeviceHub.app`. (#9126)
- Prevent Flutter upgrades from running inside the IDE on Windows when Dart SDK files may be locked. (#9092)

## 96.0.0

Expand Down
3 changes: 3 additions & 0 deletions src/io/flutter/FlutterBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,7 @@ widget.preview.retry=Reload and try again
widget.preview.choose_pubroot=Choose module and try again
widget.preview.choose_pubroot.title=Select Flutter Project
widget.preview.choose_pubroot.description=Select the Flutter project to use for Flutter Widget Preview.
flutter.upgrade.windows.title=Flutter Upgrade on Windows
flutter.upgrade.windows.message=Flutter upgrades may fail on Windows while the IDE is running because Dart SDK files can be locked by IDE processes. For the most reliable upgrade, close the IDE and run 'flutter upgrade' from a terminal. Do you want to continue here anyway?
flutter.upgrade.windows.continue=Continue with upgrade
flutter.sdk.not.found=Flutter SDK not found.
26 changes: 26 additions & 0 deletions src/io/flutter/actions/FlutterUpgradeAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,40 @@
*/
package io.flutter.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.SystemInfo;
import com.jetbrains.lang.dart.analytics.Analytics;
import com.jetbrains.lang.dart.analytics.AnalyticsData;
import io.flutter.FlutterBundle;
import io.flutter.FlutterMessages;
import io.flutter.pub.PubRoot;
import io.flutter.sdk.FlutterSdk;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class FlutterUpgradeAction extends FlutterSdkAction {
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
final Project project = event.getProject();
if (SystemInfo.isWindows && project != null && FlutterSdk.getFlutterSdk(project) != null) {
final int response = FlutterMessages.showDialog(project,
FlutterBundle.message("flutter.upgrade.windows.message"),
FlutterBundle.message("flutter.upgrade.windows.title"),
new String[]{FlutterBundle.message("flutter.upgrade.windows.continue"), "Cancel"}, 1);
if (response == 0) {
super.actionPerformed(event);
}
else {
Analytics.report(AnalyticsData.forAction(this, event));
}
return;
}

super.actionPerformed(event);
}
Comment thread
LyViolz marked this conversation as resolved.
Resolved

@Override
public void startCommand(@NotNull Project project, @NotNull FlutterSdk sdk, @Nullable PubRoot root, @NotNull DataContext context) {
sdk.flutterUpgrade().startInConsole(project);
Expand Down
Loading