flutter_in_action_2nd icon indicating copy to clipboard operation
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'

Open JasonYinH opened this issue 3 years ago • 2 comments

image

JasonYinH avatar May 12 '22 06:05 JasonYinH

一样报错。请问解决了吗

Yexi avatar May 11 '23 03:05 Yexi

Scaffold scaffold = context.findAncestorWidgetOfExactType<Scaffold>()!;
return (scaffold.appBar as AppBar).title!;

cxsunflower avatar Jan 24 '24 14:01 cxsunflower