This commit is contained in:
2026-08-05 14:37:24 +02:00
parent 6a1753b021
commit 43a703eb26
3 changed files with 43 additions and 0 deletions
@@ -0,0 +1,18 @@
local M = {}
-- This function returns project local dart, or fallsback to global
function M.executable(path)
local directory = vim.fn.isdirectory(path) == 1 and path or vim.fs.dirname(path)
local root = vim.fs.root(directory, { "pubspec.yaml" })
if root then
local fvm_dart = root .. "/.fvm/flutter_sdk/bin/dart"
if vim.fn.executable(fvm_dart) == 1 then
return fvm_dart
end
end
return "dart"
end
return M