Integrating Custom Dart Code with flutter_libserialport in FlutterFlow

Custom Code

Hello FlutterFlow Support Team,

In the project I am developing on the FlutterFlow platform, I want to create a SerialPortService class to enable serial port communication using the flutter_libserialport library. However, I am not entirely sure how to add custom Dart code in FlutterFlow and use this class in my project.

The steps I plan to take in my project are as follows:

  1. Create a Dart class named SerialPortService.

  2. Include functions in this class to handle opening, closing, reading from, and writing to the serial port using the flutter_libserialport library.

  3. Use this class in specific parts of my FlutterFlow project.

What have you tried so far?
  • Created a custom action, but I couldn't access the open serial port.

  • Tried a custom function, but couldn't add dependencies.

  • Tried a custom widget, but it wasn't suitable as I need to use it as a service.

Did you check FlutterFlow's Documentation for this topic?
Yes
1