skip to Main Content

Flutter : Instance of Future<dynamic>

I am trying to print a value returned from a function to the screen. Function: calculation.dart: Future<dynamic> getTotalCost(BuildContext context) async { final user = Provider.of<Userr?>(context, listen: false); double totalCost = 0.0; QuerySnapshot snapshot = await FirebaseFirestore.instance .collection('myOrders') .doc(user?.uid) .collection('items') .get();…

VIEW QUESTION

future: FirebaseAuth.instance.currentUser(), throws an error, need alternatives – Flutter

I have seen various questions about the same topic, and realized that 'currentUser' does not go with future after the update in FirebaseAuth import 'package:flutter/material.dart'; import 'package:firebase_auth/firebase_auth.dart'; class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState…

VIEW QUESTION
Back To Top
Search