Menu

Building a Flutter Shopping App — Part 3: Cloud Firestore and Push Notifications
🖼️

Building a Flutter Shopping App — Part 3: Cloud Firestore and Push Notifications

DEV Community: firebase·Yadnesh Teli·about 23 hours ago
#GpyCOT9w
Reading 0:00
15s threshold

Series 1 of 2 — Part 3 of 5

Building a Flutter Shopping App — Part 3: Cloud Firestore and Push Notifications

Series: Building a Flutter Shopping App — From Zero to Architecture

By this point the app had a working UI, Riverpod state management, and Firebase Auth. The next step was connecting it to a real backend — Firestore for user data persistence and Firebase Cloud Messaging for push notifications.

Integrating Cloud Firestore

I added cloud_firestore to pubspec.yaml and updated the plugin registrations. I used Firestore to persist user profile data and cart items server-side. The data structure was a top-level users collection, keyed by Firebase Auth uid, with a cart subcollection.

await FirebaseFirestore . instance . collection ( 'users' ) . doc ( currentUser . uid ) . collection ( 'cart' ) . doc ( product . id ) . set ( cartItem . toJson ());

Enter fullscreen mode

Exit fullscreen mode

One thing that caught me out was plugin registration.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.