Reputation: 945
I need to do a null check:
onWillPop: () async {
return !await listOfKeys[tabController!.index].currentState!.maybePop();
},
Upvotes: 0
Views: 56
Reputation: 1783
when you use the null safety operator ´??´ you should provide a fallback value:
onWillPop: () async {
return tabController != null
? !(await listOfKeys[tabController?.index].currentState?.maybePop() ?? false)
: false;
},
Upvotes: 1