Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
c0d17772
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c0d17772
编写于
7月 23, 2015
作者:
I
Ian Hickson
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #239 from Hixie/scheduleBuild
Remove scheduleBuild()
上级
50610918
b88df178
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
8 deletion
+14
-8
sky/sdk/example/widgets/piano.dart
sky/sdk/example/widgets/piano.dart
+0
-1
sky/sdk/lib/widgets/animated_component.dart
sky/sdk/lib/widgets/animated_component.dart
+10
-3
sky/sdk/lib/widgets/widget.dart
sky/sdk/lib/widgets/widget.dart
+4
-4
未找到文件。
sky/sdk/example/widgets/piano.dart
浏览文件 @
c0d17772
...
...
@@ -68,7 +68,6 @@ class PianoApp extends App {
}
mediaService
.
close
();
// Are we leaking all the player connections?
scheduleBuild
();
}
Widget
build
()
{
...
...
sky/sdk/lib/widgets/animated_component.dart
浏览文件 @
c0d17772
...
...
@@ -13,22 +13,29 @@ abstract class AnimatedComponent extends StatefulComponent {
final
List
<
AnimationPerformance
>
_watchedPerformances
=
new
List
<
AnimationPerformance
>();
void
_performanceChanged
()
{
setState
(()
{
// We don't actually have any state to change, per se,
// we just know that we have in fact changed state.
});
}
void
watch
(
AnimationPerformance
performance
)
{
assert
(!
_watchedPerformances
.
contains
(
performance
));
_watchedPerformances
.
add
(
performance
);
if
(
mounted
)
performance
.
addListener
(
scheduleBuil
d
);
performance
.
addListener
(
_performanceChange
d
);
}
void
didMount
()
{
for
(
AnimationPerformance
performance
in
_watchedPerformances
)
performance
.
addListener
(
scheduleBuil
d
);
performance
.
addListener
(
_performanceChange
d
);
super
.
didMount
();
}
void
didUnmount
()
{
for
(
AnimationPerformance
performance
in
_watchedPerformances
)
performance
.
removeListener
(
scheduleBuil
d
);
performance
.
removeListener
(
_performanceChange
d
);
super
.
didUnmount
();
}
...
...
sky/sdk/lib/widgets/widget.dart
浏览文件 @
c0d17772
...
...
@@ -530,7 +530,7 @@ abstract class Component extends Widget {
}
void
_dependenciesChanged
()
{
// called by Inherited.sync()
scheduleBuild
();
_
scheduleBuild
();
}
// order corresponds to _build_ order, not depth in the tree.
...
...
@@ -585,7 +585,7 @@ abstract class Component extends Widget {
_sync
(
null
,
_slot
);
}
void
scheduleBuild
()
{
void
_
scheduleBuild
()
{
if
(
_isBuilding
||
_dirty
||
!
_mounted
)
return
;
_dirty
=
true
;
...
...
@@ -662,7 +662,7 @@ abstract class StatefulComponent extends Component {
void
setState
(
void
fn
())
{
assert
(!
_disqualifiedFromEverAppearingAgain
);
fn
();
scheduleBuild
();
_
scheduleBuild
();
}
}
...
...
@@ -1190,7 +1190,7 @@ void runApp(App app, { RenderView renderViewOverride, bool enableProfilingLoop:
_container
=
new
AppContainer
(
app
);
if
(
enableProfilingLoop
)
{
new
Timer
.
periodic
(
const
Duration
(
milliseconds:
20
),
(
_
)
{
app
.
scheduleBuild
();
app
.
_
scheduleBuild
();
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录