2025-10-20 15:25:59 -05:00
2025-10-20 15:25:59 -05:00
2022-07-29 10:12:52 -05:00
2022-08-03 19:06:25 -05:00
2022-07-29 10:12:52 -05:00
2025-10-20 15:25:59 -05:00
2022-07-29 15:00:55 +00:00
2025-10-20 15:25:59 -05:00

nvim-flutter-companion

Enhances existing Flutter tools by storing selected device and emulator in local project configuration file (.flutter-companion).

  • Requires coc-flutter/coc-flutter-tools if using CoC.
  • Requires flutter-tools.nvim if using native LSP.

Global functions

_G.Flutter_Companion_Clear_Selected_Device = function()
  M.flutter_clear(false)
end

_G.Flutter_Companion_Run_Selected_Device = function()
  M.flutter_run(false)
end

_G.Flutter_Companion_Select_Device = function()
  M.flutter_list(false)
end

_G.Flutter_Companion_Clear_Selected_Emulator = function()
  M.flutter_clear(true)
end

_G.Flutter_Companion_Run_Selected_Emulator = function()
  M.flutter_run(true)
end

_G.Flutter_Companion_Select_Emulator = function()
  M.flutter_list(true)
end

Example

Example utilizes my custom Neovim distribution darcula.
This is not publicly available yet, but should be self-explanatory nonetheless :)

local M = {
  disabled = false
}

M.keymaps = function() {
  local km = require("darcula.utils.keymap")
  local companion = require("nvim-flutter-companion")
  local opts = {remap = false, silent = true}
  
  km.nmap(
    km.leader "fld",
    function()
      companion.flutter_list(false)
    end,
    opts
  )
  
  km.nmap(
    km.leader "flv",
    function()
      companion.flutter_list(false)
    end,
    opts
  )
  
  km.nmap(
    km.leader "fle",
    function()
      companion.flutter_list(true)
    end,
    opts
  )
  
  km.nmap(
    km.leader "flm",
    function()
      companion.flutter_run(true)
    end,
    opts
  )
  
  km.nmap(
    km.leader "flx",
    function()
      companion.flutter_run(false)
    end,
    opts
  )
}

M.lua_add_library = function(library_list)
  table.insert(library_list, "nvim-flutter-companion")
end

M.plug = function(Plug)
  Plug "sgraves76/nvim-flutter-companion"
end

M.setup = function()
  local plugins = require("nvim-goodies.plugins")
  if not plugins.check_requires("nvim-flutter-companion") then
    return
  end

  -- Native LSP
  require("nvim-flutter-companion").setup({use_coc = true})

  -- CoC
  require("nvim-flutter-companion").setup({use_coc = false})
end

return M
Description
Tools for Fluttter
Readme MIT 46 KiB
Languages
Lua 100%