-
Widget 树
左侧创建的树 -
Element 树
中间的树,判断是否渲染
static bool canUpdate(Widget oldWidget, Widget newWidget) {
return oldWidget.runtimeType == newWidget.runtimeType
&& oldWidget.key == newWidget.key;
}
- Rander 树
渲染树
key
image.png
Widget 树
左侧创建的树
Element 树
中间的树,判断是否渲染
static bool canUpdate(Widget oldWidget, Widget newWidget) {
return oldWidget.runtimeType == newWidget.runtimeType
&& oldWidget.key == newWidget.key;
}
image.png
本文标题:Flutter ——三颗重要的树
本文链接:https://www.haomeiwen.com/subject/xusbxktx.html
网友评论