Future<void> another_method(ValueSetter<String> callback) {
// init rustLib
await for (final event in my_method()) {
callback(event)
}
}
I call the another_method in my flutter app.
I works without a problem i can show a progress bar progress by using the callback in my UI.
BUT the desired behavior happens only the first time i call another_method.
If i call another_method a second time the stream is already completed but the rust part is executed successfully.
So i see no progress bar progressing the second time :-)
Is this desired behavior because its a single subscription stream? But the stream is created every time the method is called, or am I wrong?
I've already tried closing the subscription and creating a new one every time another_method is called, but that doesn't seem to help
How can i call this function multiple times by using streams?
Hi, i have a problem, that i can call a function using StreamSink on the rust side as parameter only once in dart.
Example:
At the dart side:
I call the
another_method
in my flutter app. I works without a problem i can show a progress bar progress by using the callback in my UI.BUT the desired behavior happens only the first time i call
another_method
. If i callanother_method
a second time the stream is already completed but the rust part is executed successfully.So i see no progress bar progressing the second time :-)
Is this desired behavior because its a single subscription stream? But the stream is created every time the method is called, or am I wrong?
I've already tried closing the subscription and creating a new one every time
another_method
is called, but that doesn't seem to helpHow can i call this function multiple times by using streams?
Best regards