I am trying to create a custom CupertinoNavigationBar but I keep getting errors related to ObstructingPreferredSizeWidget. Can someone tell me what I need to implement to fix this? The error message I am getting is:
Missing concrete implementation of 'ObstructingPreferredSizeWidget.shouldFullyObstruct'. Try implementing the missing method, or make the class abstract.
Here is the class for my CupertinoNavigationBar:
class CupertinoTopBar extends StatelessWidget
implements ObstructingPreferredSizeWidget {
Size preferredSize = Size.fromHeight(kToolbarHeight);
@override
Widget build(BuildContext context) {
return CupertinoNavigationBar(
leading: Text('AUC_CS'),
backgroundColor: CupertinoTheme.of(context).primaryColor,
);
}
}