@Nullable private static String importKnowledgeAboutOldDartSdkAndReturnGlobalLibName( final @NotNull Project project) { final String oldDartSdkPath = PropertiesComponent.getInstance().getValue("dart_sdk_path"); PropertiesComponent.getInstance().unsetValue("dart_sdk_path"); final DartSdk sdk = DartSdk.getGlobalDartSdk(); if (sdk != null) { return sdk.getGlobalLibName(); } else if (DartSdkUtil.isDartSdkHome(oldDartSdkPath)) { if (DartiumUtil.getDartiumBrowser() == null) { // configure even if getDartiumPathForSdk() returns null DartiumUtil.ensureDartiumBrowserConfigured( DartiumUtil.getDartiumPathForSdk(oldDartSdkPath)); } return ApplicationManager.getApplication() .runWriteAction( new Computable<String>() { public String compute() { return DartSdkGlobalLibUtil.createDartSdkGlobalLib(project, oldDartSdkPath); } }); } return null; }