I'm having a heck of a time trying to migrate, and I'm stuck at the StreamBuilder. The error is The operator '[]' isn't defined for the class 'Object'.
Here is my code that worked prior to the migration:
StreamBuilder(
stream: userCollection
.doc(_uid)
.collection('lists')
.doc(itemID)
.snapshots(),
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.none:
case ConnectionState.waiting:
return Center(child: CircularProgressIndicator());
break;
default:
// Completed with error
if (snapshot.hasError)
return Text(snapshot.error.toString());
// Completed with data
var itemDocument = snapshot.data!;
if(snapshot.data == null)
return CircularProgressIndicator();
itemCategory = itemDocument!['category'] ?? ''; // <- ERROR HERE
itemTitleController.text = itemDocument!['title'] ?? ''; // <- ERROR HERE
_itemImportant = itemDocument!['important'] ?? false; // <- ERROR HERE