fluttercommunity / fluttercommunity/flutter_uploader

uploader.result.listen((result) calls too many times. version flutter_uploader_beta6

Open
#144 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
218
Forks
172
PR merge metrics
No merged PRs in 30d

Description

StreamSubscription _resultSubscription;

_resultSubscription = uploader.result.listen((result) async {
print("Result Result Result Result Result");
print("onResponse : " + result.response);
print(result);
print(
'IN MAIN APP: ${result.taskId}, status: ${result.status}, statusCode: ${result.statusCode}, headers: ${result.headers}');

var tmp = {}..addAll(_tasks);
tmp.putIfAbsent(result.taskId, () => UploadItem(result.taskId));
tmp[result.taskId] =
tmp[result.taskId].copyWith(status: result.status, response: result);

// setState(() => _tasks = tmp);
}, onError: (ex, stacktrace) {
print('exception: $ex');
print('stacktrace: $stacktrace' ?? 'no stacktrace');
});

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.