waveForm method

  1. @override
Future<void> waveForm({
  1. required List<int> timings,
  2. required List<int> amplitudes,
})
override

Implementation

@override
Future<void> waveForm({
  required List<int> timings,
  required List<int> amplitudes,
}) async {
  if (timings.any((item) => item < 0) || amplitudes.any((item) => item < 0)) {
    throw Exception("Negative number not accepted");
  }
  return await methodChannel.invokeMethod(
    "wave_form",
    {
      "timings": timings,
      "amplitudes": amplitudes,
    },
  );
}