The AppBarDesign can't be assigned to the parameter type 'PreferredSizeWidget'


Daftar Isi :


    The error occurs when attempting to assign an AppBarDesign object to a parameter that expects a 'PreferredSizeWidget' type. This type mismatch prevents the assignment and triggers the error.


    To fix this error, ensure that the assigned object matches the expected parameter type. Consider using a widget that implements the 'PreferredSizeWidget' interface or has a similar structure.


    Example Code Fixing :

      appBar: MyAppBar(),
    class MyAppBar extends StatelessWidget implements PreferredSizeWidget {
      Size get preferredSize => const Size.fromHeight(100);
      Widget build(BuildContext context) {
        return Container(color:;