Closed gen0083 closed 6 years ago
I think that cloud_firestore
version should be 0.2.9
.
Because, some a library interface has been changed between 0.2.9
and 0.2.10
and later.
// 0.2.9
part of cloud_firestore;
class DocumentReference {
Future<Null> setData(Map<String, dynamic> data, [SetOptions options]) {
return Firestore.channel.invokeMethod(
'DocumentReference#setData',
<String, dynamic>{'path': path, 'data': data, 'options': options?._data},
);
}
// 0.2.10
part of cloud_firestore;
class DocumentReference {
Future<void> setData(Map<String, dynamic> data, [SetOptions options]) {
return Firestore.channel.invokeMethod(
'DocumentReference#setData',
<String, dynamic>{'path': path, 'data': data, 'options': options?._data},
);
}
This change affects return type of FavoriteRepository#update()
.
// droidkaigi2018-flutter : favorite_repository_impl.dart
class FavoriteRepositoryImpl extends FavoriteRepository {
Future<Null> update(String userId, String sessionId, bool favorite) async {
return await _firestore
.collection("users/$userId/favorites")
.document(sessionId)
.setData({'favorite': favorite}).then((result) {
_cache[sessionId] = favorite;
return result;
});
}
@gen0083 @konifar Can you change version to 0.2.9
❓😃
Thank you for great suggestion @sho5nn ! and sorry for late response 🙇
I tried version 0.2.9
and it looks fine.
But I think this PR is too small to useful. On Flutter version 0.3.1 (Dart 2.0.0-dev.48.0.flutter-fe606f890b) there are some errors in this project. I'll send another PR to adopt flutter 0.3.1, and this PR close.
Issue
I got error when run
flutter packages get
.Overview
Update cloud_firestore version (actually it used 0.2.12 in my machine)