flutter_in_action_2nd
flutter_in_action_2nd copied to clipboard
context.findAncestorWidgetOfExactType<Scaffold>()提示A value of type 'Scaffold?' can't be assigned to a variable of type 'Scaffold'

一样报错。请问解决了吗
Scaffold scaffold = context.findAncestorWidgetOfExactType<Scaffold>()!;
return (scaffold.appBar as AppBar).title!;