setOption method

Future<void> setOption (
  1. int category,
  2. String key,
  3. dynamic value
)

set option value must be int or String

Implementation

Future<void> setOption(int category, String key, dynamic value) async {
  await _nativeSetup.future;
  if (value is String) {
    FijkLog.i("$this setOption k:$key, v:$value");
    return _channel.invokeMethod("setOption",
        <String, dynamic>{"cat": category, "key": key, "str": value});
  } else if (value is int) {
    FijkLog.i("$this setOption k:$key, v:$value");
    return _channel.invokeMethod("setOption",
        <String, dynamic>{"cat": category, "key": key, "long": value});
  } else {
    FijkLog.e("$this setOption invalid value: $value");
    return Future.error(
        ArgumentError.value(value, "value", "Must be int or String"));
  }
}