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
This commit is contained in:
Adam Barth
2015-07-21 14:38:44 -07:00
parent 6b748e653e
commit de717bafe9
2 changed files with 13 additions and 9 deletions

View File

@@ -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,

View File

@@ -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>[];