diff --git a/lib/services/cloud/firebase_cloud_storage.dart b/lib/services/cloud/firebase_cloud_storage.dart index 61eeedd..936af35 100644 --- a/lib/services/cloud/firebase_cloud_storage.dart +++ b/lib/services/cloud/firebase_cloud_storage.dart @@ -25,25 +25,12 @@ class FirebaseCloudStorage { } } - Stream> allNotes({required String ownerUserId}) => - notes.snapshots().map((event) => event.docs - .map((doc) => CloudNote.fromSnapshot(doc)) - .where((note) => note.ownerUserId == ownerUserId)); - - Future> getNotes({required String ownerUserId}) async { - try { - return await notes - .where( - ownerUserIdFieldName, - isEqualTo: ownerUserId, - ) - .get() - .then( - (value) => value.docs.map((doc) => CloudNote.fromSnapshot(doc)), - ); - } catch (e) { - throw CouldNotGetAllNotesException(); - } + Stream> allNotes({required String ownerUserId}) { + final allNotes = notes + .where(ownerUserIdFieldName, isEqualTo: ownerUserId) + .snapshots() + .map((event) => event.docs.map((doc) => CloudNote.fromSnapshot(doc))); + return allNotes; } Future createNewNote({required String ownerUserId}) async { diff --git a/pubspec.yaml b/pubspec.yaml index 57b6873..49ca9f9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 +version: 1.1.0+1 environment: sdk: ">=2.15.0 <3.0.0"