thuongbn
thuongbn

Reputation: 1

RangeError (RangeError: Value not in range: 8)

I try to develop a plugin with flutter platform channel, everything is fine, but sometimes I got the following exception:

RangeError (RangeError: Value not in range: 8)"

The exception is (sometimes) thrown at this line:

final result = await methodChannel.invokeMethod<List<double>>('getSamples');

In native side code

vector<double> vbuffer(512, 1);
HRESULT hr = player->GetSamples(vbuffer);
if (SUCCEEDED(hr)) {
    result->Success(flutter::EncodableValue(vbuffer));
} else {
  result->Error("Error", "Error getting sample buffer");
}

Is there a limit for amount of data can be passed to flutter? Or mismatch type? Thanks in advance.

I try to search some similar question but nothing helpful

Upvotes: 0

Views: 38

Answers (0)

Related Questions