skip to Main Content

Unable to query data from Firebase

I'm trying to retrieve data from Firebase. Here's my code snippet Future main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); // DatabaseReference ref = FirebaseDatabase.instance.ref(); runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { final docRef…

VIEW QUESTION

Firebase – How to StreamBuild a single document in flutter

I have this code Stream<List<Ticket>> readTicket() => FirebaseFirestore.instance .collection('tickets') .where("added_by", isEqualTo: member?.uid) .snapshots() .map( (snapshots) => snapshots.docs .map( (doc) => Ticket.fromJson( doc.data(), ), ) .toList(), ); It does exactly want I wanted to do but I want the one that…

VIEW QUESTION
Back To Top
Search