Run a Windows/Mac/Linux command from Flutter and read stdout - flutter

I am working on a new product, and I have developed a flutter application using Flutter Blue Plus for connectivity to a custom piece of hardware I designed. FBP currently only supports iOS and Android. Even though it is 2023, integrated BLE for Desktops is still a bit underdeveloped and I don't want to write platform specific BLE code yet. The solution is to use a USB Dongle that I have used in the past, which has the full stack and all the hardware to work on any OS with USB access (BLED112 by Silicon Labs). The customers will be required to buy the dongle for $15 until BLE support for desktops mature. I did this before and it was fine.
My question is how do I run an executable from Flutter, and read all of the standard output, without blocking?
I plan on using a simple Python script that interfaces to the dongle with the serial port and spits out GAP and GATT data in real time. I want to launch the Python script from Flutter when Linux/Windows/macOS is detected.
I want to make sure I am going down the correct path with this idea.

Use process_run package.
final shell = Shell();
await shell.run('''
# Display dart version
dart --version
# Display pub version
flutter doctor
''');

Related

Is there a way to run flutter from vs code to a real device like iphone 11 pro? Working on windows

So i'm new at flutter and i want to run my app to my real device. Working on windows 10 with vs code. I want to do this because when i run my app with android emulators my pc starts going slow.
Thanks!
You can follow this tutorial if you want to run your application on an actual device with USB connection: https://www.youtube.com/watch?v=aohkII1C4JY&ab_channel=JohannesMilke
And also there is another way to run your app on an actual device which you can do it wirelessly: https://www.youtube.com/watch?v=BymD9pxtVwY&t=161s&ab_channel=AppMakingAcademy

Is there any flutter packages that support Bluetooth on windows

Currently I am working on a project that needs to have Bluetooth features in Desktop
But I didn't find any working packages.
Can any one suggest me the good packages ??
check out this link.
https://www.tldevtech.com/best-bluetooth-packages-for-flutter/
From the link, quick_blue(https://pub.dev/packages/quick_blue) library supports Bluetooth features in Desktop from Flutter.
Try those BLE packages,they are supported to windows.
https://pub.dev/packages/quick_blue
https://pub.dev/packages/flutter_blue_plugin
From quick_ble package have following features
Scan BLE peripheral
Connect BLE peripheral
Discover services of BLE peripheral
Transfer data between BLE central & peripheral
You can use win_ble package.
This is specifically developed to work for Flutter for Windows. Also it's up to date.
Current version of it is 0.04
You can use win_ble package.
This is specifically developed to work for Flutter for Windows. Also it's up to date.
Check it out here👇
win_ble

ESC/POS printer with flutter desktop application?

Folks we are developing Flutter windows desktop application it is the Point of sale application in this main feature is printing we can find lots of resources on ESC/pos topic in the android flutter application or even through method channel we can access the printer but in windows its quite challenging where and how to start so far we have used https://pub.dev/packages/printing this library which prints but the length of the print is limited to the size of the A4, so even I have tried to run ESC/pos command through cmd using dart but no luck can anyone help me out where to start ????
Thanks in advance !!

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?
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.
You need to write some c++ code, and see if you can find some native usb lib to make calls on.

Windows Development with flutter

I am learning flutter right now and want to know which platforms support flutter applications.
I know that flutter supports iOS and Android.
I want to know if we can run flutter programs on windows.
Flutter Desktop: currently this effort is still under way
Google has an example project project.
About Flutter on Windows:
The current Windows shell is a GLFW placeholder, to allow early
experimentation. It will be replaced in the future with a Win32 or UWP
shell that allows view-level embedding of Flutter within an
application.
Expect the APIs for the final shell to be radically different from the
current implementation.
Source: Wiki