1
answer
1
watching
82
views

Followed your suggestion on the previous question -

It still failed. See Flutter program below screenshot listed below with your suggestions.

Screenshot of the error msg - Look under output section


import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/widgets.dart'; import 'src/google_fonts_base.dart'; import 'src/google_fonts_descriptor.dart'; import 'src/google_fonts_variant.dart'; import 'src/google_fonts_family_with_variant.dart'; import 'src/google_fonts_css.dart'; import 'src/utils.dart'; import 'dart:ui' as ui; import 'package:google_fonts/google_fonts.dart' show GoogleFonts; import './pages/tasklist/tasklist.dart'; import 'package:todolist/pages/tasklistdetail/tasklistdetail.dart'; import 'package:todolist/pages/authscreen/authscreen.dart';
void main() async {   WidgetsFlutterBinding.ensureInitialized();   await Firebase.initializeApp();   runApp(MyApp()); }
class MyApp extends StatelessWidget {   final Stream<QuerySnapshot> _usersStream =       FirebaseFirestore.instance.collection('users').snapshots();
   MyApp({super.key});
  // This widget is the root of your application.   @override   Widget build(BuildContext context) {     return MaterialApp(       title: 'Flutter Demo',       theme: ThemeData(         primarySwatch: Colors.blue,         textTheme: GoogleFonts.robotoCondensedTextTheme(),       ),       home: StreamBuilder(           stream: _usersStream,           builder: (context, userSnapshot) {             if (userSnapshot.hasData) {               print(userSnapshot.data!.docs[0].data);               return const TaskListPage(                 title: "Task List Page",               );             } else {               return AuthScreen();             }           }),       routes: {         '/tasklist': ((context) => const TaskListPage(               title: "Task List Page",             )),         '/tasklistdetail': ((context) => const TaskListDetailPage(               title: "Task List Detail Page",             )),         '/login': ((context) => AuthScreen())       },     );   } }

For unlimited access to Homework Help, a Homework+ subscription is required.

Avatar image
Read by 1 person

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in