flutter the argument sliverappbar can be assigned to parameter type 'preferredsizewidget' code example
Example: The argument type 'ChatRoomAppBar' can't be assigned to the parameter type 'PreferredSizeWidget'
Scaffold(
appBar: MyAppBar(),
)
...
class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
@override
Size get preferredSize => const Size.fromHeight(100);
@override
Widget build(BuildContext context) {
return Container(color: Colors.red);
}
}