Skip to content

Commit

Permalink
fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkrishna0512 committed Jul 25, 2022
1 parent 7fcd062 commit ebaa6ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/models/ForBorrowing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ForBorrowing extends StatelessWidget {
this.userEmailToDisplay = "",
}) : super(key: key);

late String? userEmailToDisplay;
late String userEmailToDisplay;
List<QueryDocumentSnapshot> listingData = [];

@override
Expand All @@ -37,7 +37,7 @@ class ForBorrowing extends StatelessWidget {
},
),
StreamBuilder(
stream: userEmailToDisplay == null || userEmailToDisplay!.isEmpty
stream: userEmailToDisplay.isEmpty
? FirebaseFirestore.instance
.collection('listings')
.where('forRent', isEqualTo: false)
Expand All @@ -62,7 +62,7 @@ class ForBorrowing extends StatelessWidget {
);
} else if (snapshot.data == null) {
return const Text("No Listings for Borrowing Yet :( ");
} else if (snapshot.hasData) {
} else if (!snapshot.hasData) {
return const Text("Awaiting result...");
} else if (snapshot.hasError) {
print(snapshot.error);
Expand Down
2 changes: 1 addition & 1 deletion lib/models/ForRenting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ForRenting extends StatelessWidget {
},
),
StreamBuilder(
stream: userEmailToDisplay!.isEmpty || userEmailToDisplay == null
stream: userEmailToDisplay!.isEmpty
? FirebaseFirestore.instance
.collection('listings')
.where('forRent', isEqualTo: true)
Expand Down

0 comments on commit ebaa6ac

Please sign in to comment.