Before I explain the problem, I’m currently making an e-diary app that detects emotion through certain keywords. The app has a sign in and register page (for authentication), along with a ‘homepage’ (read: page navigator) that allows seamless transition of dashboard, calendar, statistic, and image page using bottomNavigationBar but even then…when I want to sign out of the app, I have to manually close and re-open the app so it goes back to the sign in page.
I’m using Firebase for the database and Android Studio to code the flutter app.
Now the problem, the firestore snapshots won’t show up in the app. But when switching pages quickly, I can see glimpses of the images tied to the userID before it shows a blank page.
I’ll leave the google drive link with both the zip and apk file for anyone who wants to test it out.
My plans for both dashboard and calendar would be that both would show a listtile of the entries (if there were any), with a difference that the Dashboard would sort the entries by date in descending order while calendar would show the entries based on the selected date (think like the calendar app in android). The statistic page would show a pie chart with the overall emotions gathered from the entries and the image page would show the images from the entries in a grid (like gallery).
Now I’ve set the cloud firestore rules as follows:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /entries/{entryId} {
allow read, write, create : if request.auth != null;
}
}
}
Along with storage:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /images/{userId}/{imagePaths=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
Cheese Font is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.