Error: The argument type 'MyAppBar' can't be assigned to the 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);
}
}