implements PreferredSizeWidget

5/11/2023

Is Flutter 3.10 giving you this error about your app bar after the upgrade and the solution seems to be non obvious?

"message": "The class 'PreferredSizeWidget' can't be used as a mixin because it's neither a mixin class nor a mixin.",
"source": "dart",

You need to change the keyword with to implements. Form this

class MyAppBar extends StatelessWidget with PreferredSizeWidget

to this:

class MyAppBar extends StatelessWidget implements PreferredSizeWidget

I feel it’s a Flutter bug but the fix is quick and simple.