Skip to content

Commit

Permalink
Clean up and update FlutterConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Nov 20, 2024
1 parent 06aa785 commit 11e0147
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
8 changes: 4 additions & 4 deletions flutter-idea/src/io/flutter/FlutterBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ flutter.initializer.module.converted.title=Flutter module type updated

flutter.reload.firstRun.title=Flutter supports hot reload!
flutter.reload.firstRun.content=Apply changes to your app in place, instantly.
flutter.reload.firstRun.url=https://flutter.dev/docs/development/tools/hot-reload
flutter.reload.firstRun.url=https://flutter.dev/to/hot-reload

flutter.io.gettingStarted.url=https://flutter.dev/docs/get-started/install
flutter.io.gettingStarted.IDE.url=https://flutter.dev/docs/development/tools/ide
flutter.io.runAndDebug.url=https://flutter.dev/docs/development/tools/ide/android-studio#running-and-debugging
flutter.io.gettingStarted.url=https://flutter.dev/to/install
flutter.io.gettingStarted.IDE.url=https://docs.flutter.dev/tools/android-studio
flutter.io.runAndDebug.url=https://docs.flutter.dev/tools/android-studio#running-and-debugging

devicelist.loading=Loading...

Expand Down
31 changes: 20 additions & 11 deletions flutter-idea/src/io/flutter/FlutterConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@

package io.flutter;

import java.util.Arrays;
import java.util.List;
import org.jetbrains.annotations.NotNull;

public class FlutterConstants {
import java.util.Set;

// From: https://github.com/dart-lang/sdk/blob/master/pkg/front_end/lib/src/scanner/token.dart
public static final List<String> DART_KEYWORDS = Arrays.asList(
public final class FlutterConstants {

// From: https://github.com/dart-lang/sdk/blob/main/pkg/_fe_analyzer_shared/lib/src/scanner/token.dart
public static final Set<String> DART_KEYWORDS = Set.of(
"abstract",
"as",
"assert",
"async",
"await",
"base",
"break",
"case",
"catch",
Expand All @@ -33,6 +35,7 @@ public class FlutterConstants {
"enum",
"export",
"extends",
"extension",
"external",
"factory",
"false",
Expand All @@ -48,6 +51,7 @@ public class FlutterConstants {
"in",
"interface",
"is",
"late",
"library",
"mixin",
"native",
Expand All @@ -58,8 +62,10 @@ public class FlutterConstants {
"operator",
"part",
"patch",
"required",
"rethrow",
"return",
"sealed",
"set",
"show",
"source",
Expand All @@ -74,13 +80,15 @@ public class FlutterConstants {
"typedef",
"var",
"void",
"when",
"while",
"with",
"yield"
);

// From: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/create.dart
public final static List<String> FLUTTER_PACKAGE_DEPENDENCIES = Arrays.asList(
// From: https://github.com/flutter/flutter/blob/main/packages/flutter_tools/lib/src/commands/create_base.dart
@NotNull
public final static Set<String> FLUTTER_PACKAGE_DEPENDENCIES = Set.of(
"analyzer",
"args",
"async",
Expand All @@ -106,12 +114,13 @@ public class FlutterConstants {
"test",
"utf",
"watcher",
"yaml");
"yaml"
);

// Aligned w/ VSCode (https://github.com/flutter/flutter-intellij/issues/2682)
public static String RELOAD_REASON_MANUAL = "manual";
public static String RELOAD_REASON_SAVE = "save";
public static String RELOAD_REASON_TOOL = "tool";
public static final String RELOAD_REASON_MANUAL = "manual";
public static final String RELOAD_REASON_SAVE = "save";
public static final String RELOAD_REASON_TOOL = "tool";

public static final String FLUTTER_SETTINGS_PAGE_ID = "flutter.settings";
public static final String INDEPENDENT_PATH_SEPARATOR = "/";
Expand Down

0 comments on commit 11e0147

Please sign in to comment.