flutter-tools.nvim icon indicating copy to clipboard operation
flutter-tools.nvim copied to clipboard

[ISSUE] FlutterDevices Slow to Open

Open praxder opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

When you run :FlutterDevices it takes multiple seconds to open the popup window with all devices

Expected Behavior

The window opens immediately

Steps To Reproduce

Run :FlutterDevices

Environment

- OS: Mac 14.2.1 (23C71)
- Flutter version: 3.16.9
- Is flutter in $PATH: Yes
- neovim version: 0.9.5

Anything else?

I would imagine that this is taking so long as it's querying devices every time the command is run. A potential alternative solution would be to only fetch devices when the dialog is first opened and then cache them. Then, on subsequent opens, show the cache as well as another cell that says "Refresh" that would fetch all devices again.

praxder avatar Feb 27 '24 16:02 praxder