-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show error when Dart SDK is not set correctly (#636) #646
Conversation
Since the Flutter SDK is derived the from Dart SDK, we actually handle this by reporting: 'No Flutter SDK configured'. When the user fixes the Flutter SDK, the Dart SDK will also be fixed. Fixed combo box to display correctly when no Flutter SDK is configured. Fire a Flutter SDK changed event when the user changes the Flutter SDK. Removed dead code. Not done: when the user changes the Dart SDK, we should fire a Flutter SDK changed event.
Cool! I added a comment to the older PR to the effect that I don't see how we're guarding against the case where a user.
Curious what @alexander-doroshko is thinking there. This is what the old logic to detect mismatched SDKs was intended to catch. |
Answered already I think, but I'll answer again here to avoid confusion. When you set the Dart SDK to a different location, the Flutter SDK is automatically unset (because the Dart SDK changed, and the Flutter SDK is derived from it). However, this wasn't visible to the user due to UI bugs - it would still show the old Flutter SDK even though the setting changed. I've mostly fixed the UI bugs in this patch - in particular see the changes in FlutterSettingsConfigurable. |
Ah! Thanks for the clarification. It was the UI bug that was throwing me off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
*/ | ||
private void updateVersionTextIfCurrent(@NotNull FlutterSdk sdk, @NotNull String value) { | ||
FlutterSdk current = FlutterSdk.forPath(getSdkPathText()); | ||
if (current == null || !sdk.getHomePath().equals(current.getHomePath())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe consider Objects.equals(sdk.getHomePath(), current.getHomePath()))
? (Gracefully handles null
s -- not that there should be any!)
Since the Flutter SDK is derived the from Dart SDK, we actually handle
this by reporting: 'No Flutter SDK configured'. When the user fixes
the Flutter SDK, the Dart SDK will also be fixed.
Fixed combo box to display correctly when no Flutter SDK is configured.
Fire a Flutter SDK changed event when the user changes the Flutter SDK.
Removed dead code.
Not done: when the user changes the Dart SDK, we should fire a Flutter
SDK changed event.
(Sorry about the repost; I accidentally deleted the branch for the last pull request.)