1、Flutter Object继承关系
该继承图为flutter2.2版本最新继承关系图。

视频讲解地址
2、Flutter Widget组件继承图
Widget
下面有五个子类, PreferredSizeWidget
下面总共有6个组件, ProxyWidget
下面总共有47个组件, RenderObjectWidget
下面总共有94个组件, StateFulWidget
下面总共有167个组件, StatelessWidget
下面总共有108个组件,加上自身5个组件,所以总共的组件有高达427之多,这可能也是很多人觉得Flutter很难学的原因之一,其实我们只要掌握一些基本常用的可以了。
-
PreferredSizeWidget:主要用于
AppBar
和TabBar
, 通过继承该类可实现自定义大小。 -
ProxyWidget: 是一个抽象类,主要用于提供给子
Widget
的抽象Widget
-
RenderObjectWidget:是一个抽象类,
RenderObjectWidgets
为RenderObjectElements
提供配置,它包装RenderObjects
,提供应用程序的实际渲染。 -
StateFulWidget:具有可变状态的
Widget
-
StatelessWidget:不需要可变状态的
Widget

3、PreferredSizeWidget

4、ProxyWidget


5、RenderObjectWidget

6、StateFulWidget






7、StatelessWidget




网友评论