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

前端 未结 5 1534
刺人心
刺人心 2021-02-02 06:42

Anyone please give some information why this is happening?

When I try to add a class AppBarDesign which implements appBar flutter is gi

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 06:49

    helpful tips to implementing that without searching any other topics:

    class ApplicationToolbar extends StatelessWidget with PreferredSizeWidget{
      @override
      Widget build(BuildContext context) {
        return AppBar( ... );
      }
    
      @override
      Size get preferredSize => Size.fromHeight(kToolbarHeight);
    }
    

提交回复
热议问题