theshiftstudio / flutter_firebase_redux_sync

Flutter, Redux and Firebase Cloud Firestore in sync
16 stars 11 forks source link

compiler message: ... #2

Open Simpler1 opened 5 years ago

Simpler1 commented 5 years ago

After creating the firestore database according to the website and running flutter test, the following errors are generated.

$ flutter test
compiler message: file:///C:/Users/user1/git_projects/flutter_firebase_redux_sync/lib/redux/middleware.dart:33:68: Error: A value of type '() → dart.async::Stream<cloud_firestore::DocumentSnapshot>' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
compiler message: Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
compiler message:   return new Observable(Firestore.instance.document("users/tudor").snapshots) // 5
compiler message:                                                                    ^
compiler message: file:///C:/Users/user1/git_projects/flutter_firebase_redux_sync/lib/redux/middleware.dart:34:12: Error: The function expression type '(cloud_firestore::DocumentSnapshot) → dart.core::int' isn't of expected type '(dynamic) → dart.core::int'.
compiler message: Change the type of the function expression or the context in which it is used.
compiler message:       .map((DocumentSnapshot doc) => doc['counter'] as int); // 6
compiler message:            ^
compiler message: file:///C:/Users/user1/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/rxdart-0.16.0+1/lib/src/observable.dart:1162:26: Error: A value of type '#lib1::DematerializeStreamTransformer<#lib2::Observable::T>' can't be assigned to a variable of type 'dart.async::StreamTransformer<#lib2::Observable::T, #lib2::Observable::dematerialize::S>'.
compiler message: Try changing the type of the left hand side, or casting the right hand side to 'dart.async::StreamTransformer<#lib2::Observable::T, #lib2::Observable::dematerialize::S>'.
compiler message:     return transform(new DematerializeStreamTransformer<T>());
compiler message:                          ^
compiler message: file:///C:/Users/user1/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/rxdart-0.16.0+1/lib/src/observable.dart:1347:35: Error: No named parameter with the name 'defaultValue'.
compiler message:           stream.firstWhere(test, defaultValue: defaultValue, orElse: orElse));
compiler message:                                   ^^^^^^^^^^^^
compiler message: file:///C:/Users/user1/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/rxdart-0.16.0+1/lib/src/observable.dart:1467:34: Error: No named parameter with the name 'defaultValue'.
compiler message:           stream.lastWhere(test, defaultValue: defaultValue, orElse: orElse));
compiler message:                                  ^^^^^^^^^^^^
00:00 +0 -1: loading C:\Users\user1\git_projects\flutter_firebase_redux_sync\test\widget_test.dart [E]
  Failed to load "C:\Users\user1\git_projects\flutter_firebase_redux_sync\test\widget_test.dart":
  Compilation failed
  Test: C:\Users\user1\git_projects\flutter_firebase_redux_sync\test\widget_test.dart
  Shell: C:\Programs\flutter\bin\cache\artifacts\engine\windows-x64\flutter_tester.exe

00:00 +0 -1: Some tests failed.

Here is the flutter doctor output:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.5.1, on Microsoft Windows [Version 10.0.14393], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.1)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] Connected devices (1 available)

• No issues found!
Simpler1 commented 5 years ago

Resolved by PR https://github.com/theshiftstudio/flutter_firebase_redux_sync/pull/3/commits/bf1325ddc03fc5f757f8f174889902bd858f19bb