Skip to content
Closed
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
19 changes: 19 additions & 0 deletions lua/flutter-tools/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,25 @@ local function run(opts, project_conf, launch_config)
local is_flutter_project = has_flutter_dependency_in_pubspec(cwd)
if is_flutter_project then
ui.notify("Starting flutter project...")

-- Prepend '--no-version-check' so that Flutter CLI tool does
-- not look for a new version.
--
-- Executing any command with the Flutter CLI tool makes the tool look
-- for a new version and optionally prints this banner:
--
-- ┌─────────────────────────────────────────────────────────┐
-- │ A new version of Flutter is available! │
-- │ │
-- │ To update to the latest version, run "flutter upgrade". │
-- └─────────────────────────────────────────────────────────┘
--
-- The problem is that this banner causes errors when parsing the
-- output of the running command. To fix this, we omit the version
-- check by default, but give the user the option to enable it.
if not config.flutter_version_check then
args = table.insert(args, 1, "--no-version-check")
end
else
ui.notify("Starting dart project...")
end
Expand Down
5 changes: 5 additions & 0 deletions lua/flutter-tools/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ local config = {
pre_run_callback = nil,
root_patterns = { ".git", "pubspec.yaml" },
fvm = false,
--- True if the Flutter CLI tool should check if a new version is
--- available before executing.
---
--- Defaults to false.
flutter_version_check = false,
widget_guides = {
enabled = false,
debug = false,
Expand Down
Loading