can't be assigned to the parameter type 'preferred size widget' 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);
}
}