Implemented the upload status snackbar on the home screen, created the [DistinctStreamTransformer] and refactored how screens decide when to show a snackbar

This commit is contained in:
Mariano Uvalle 2019-04-24 15:11:39 -05:00
parent 28a112779a
commit 10aabed07e
8 changed files with 186 additions and 68 deletions

15
test/src/utils_test.dart Normal file
View file

@ -0,0 +1,15 @@
import 'dart:async';
import 'package:do_more/src/utils.dart';
import 'package:flutter_test/flutter_test.dart';
main() {
group('DistinctStreamTransformer', () {
test('should only emit non repeated elements', () {
final stream = Stream.fromIterable([1, 1, 1, 2, 2, 2, 1, 1, 1, 1]);
final transformedStream = stream.transform(DistinctStreamTransformer());
expect(transformedStream.toList(), completion(equals([1, 2, 1])));
});
});
}