Search code examples
flutterdartpluginsprintingflutter-desktop

How to edit plugin to make it working for Desktop Application


i'm working on a task for detecting USB connected devices (printers) for Flutter desktop application. I found many plugins but they are not working on desktop app. The code throws exception in detecting list of connected USB devices The exception it throws is

No implementation found for the method listDevices for the channel usb_serial

How i can change that plugin for desktop, to find USB connected devices/or any other solution?


Solution

  • By definition, a Flutter plugin has native code for each platform. That error is because you're using a plugin that has not been implemented for your platform.

    The way you would change the plugin to make it work would be to write an implementation of that plugin's native code for each desktop platform you want to add support for.