serial_port_win32
3.0.0, released 3 months ago by an unverified publisher
A SerialPort library using win32 API for connecting real devices via serial port on Windows.
What it does
Provides an interface to list available COM ports, open serial connections with specific configurations like baud rate and stop bits, and perform read and write operations using the Win32 API.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to communicate with hardware connected via a serial port on Windows.
- You are building a desktop application targeting Windows that talks to microcontrollers, sensors, or serial devices.
Skip it when
- You need cross-platform serial port support (this package only supports Windows).
- You require high-level reactive streams for continuous reading without imperative buffer management.
Strengths
- Allows querying detailed port metadata including friendly names, hardware IDs, and manufacturer names.
- Provides flexible read options including timeout-based reads, exact size reads, and delimiter reads.
Weaknesses
- Platform support is strictly limited to Windows.
- Port instances use a singleton pattern, requiring care when managing multiple connections or instances.
Setup
- Kind
- FFI (native library)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Requires Windows. Only supports Windows platform.
import 'package:serial_port_win32/src/serial_port.dart';
void main() {
var ports = SerialPort.getAvailablePorts();
print(ports);
if (ports.isNotEmpty) {
var port = SerialPort(ports[0]);
port.BaudRate = CBR_115200;
port.StopBits = ONESTOPBIT;
port.close();
}
}Alternatives
Packages that do the same job and could replace serial_port_win32.
- location
Flutter plugin to get real-time device location across platforms.
94Compare - android_id
A Flutter plugin for retrieving the Android ID on Android devices.
87Compare - flutter_blue_plus
Flutter plugin for connecting to Bluetooth Low Energy devices.
90Compare - safe_device
Detect jailbreak/root, emulator, mock location and other safety flags on iOS/Android devices.
87Compare
Works with
Packages commonly used together with serial_port_win32: ones it builds on, ones built on it, and its own family.