Commit de717baf authored by Adam Barth's avatar Adam Barth

Images don't appears in VariableHeightScrollables

When we build widgets during layout we weren't notifying those widgets that
they were mounted. Now we notify mount status changes when exiting build phases
inside layout.

Fixes #176
parent 6b748e65
......@@ -8,6 +8,8 @@ import 'package:sky/widgets/block_viewport.dart';
import 'package:sky/widgets/scrollable.dart';
import 'package:sky/widgets/widget.dart';
export 'package:sky/widgets/block_viewport.dart' show BlockViewportLayoutState;
class VariableHeightScrollable extends Scrollable {
VariableHeightScrollable({
String key,
......
......@@ -6,7 +6,6 @@ import 'dart:async';
import 'dart:collection';
import 'dart:sky' as sky;
import 'package:sky/base/debug.dart';
import 'package:sky/base/hit_test.dart';
import 'package:sky/mojo/activity.dart' as activity;
import 'package:sky/rendering/box.dart';
......@@ -600,17 +599,20 @@ int _inLayoutCallbackBuilder = 0;
class LayoutCallbackBuilderHandle { bool _active = true; }
LayoutCallbackBuilderHandle enterLayoutCallbackBuilder() {
if (!inDebugBuild)
return null;
_inLayoutCallbackBuilder += 1;
assert(() {
_inLayoutCallbackBuilder += 1;
return true;
});
return new LayoutCallbackBuilderHandle();
}
void exitLayoutCallbackBuilder(LayoutCallbackBuilderHandle handle) {
if (!inDebugBuild)
return;
assert(handle._active);
handle._active = false;
_inLayoutCallbackBuilder -= 1;
assert(() {
assert(handle._active);
handle._active = false;
_inLayoutCallbackBuilder -= 1;
return true;
});
Widget._notifyMountStatusChanged();
}
List<int> _debugFrameTimes = <int>[];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment