I can't seem to access my global variables _firestore and loggedInUser from a different class in flutter / dart. From what I read in the documentation and online, this should be possible?
Creating the global variables:
import 'package:cloud_firestore/cloud_firestore.dart';
final _firestore = Firestore.instance;
FirebaseUser loggedInUser;
class TheSlateScreen extends StatefulWidget {
Trying to access them here:
import 'package:theslate/screens/theslate_screen.dart';
class SlateTasks extends ChangeNotifier {
void addTask(String newTaskTitle) {
_firestore.collection('Test').add({
'Task': newTaskTitle,
'User': loggedInUser.email,
});