Answers for "The argument type 'ChatRoomAppBar' can't be assigned to the parameter type 'PreferredSizeWidget'"

1

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);
  }
}
Posted by: Guest on September-03-2020

Code answers related to "The argument type 'ChatRoomAppBar' can't be assigned to the parameter type 'PreferredSizeWidget'"

Browse Popular Code Answers by Language