toJsonString static method

String toJsonString(
  1. HapticPattern pattern
)

Converts a haptic pattern to a JSON string

The resulting JSON can be saved to storage or transmitted over the network.

Implementation

static String toJsonString(HapticPattern pattern) {
  return jsonEncode(pattern.toJson());
}