diff --git a/packages/devtools/lib/src/timeline/event_details.dart b/packages/devtools/lib/src/timeline/event_details.dart index 7e7e0ee77fa..2bc3acd8a30 100644 --- a/packages/devtools/lib/src/timeline/event_details.dart +++ b/packages/devtools/lib/src/timeline/event_details.dart @@ -3,8 +3,6 @@ // found in the LICENSE file. import 'dart:html' as html; -import 'package:js/js.dart'; - import '../globals.dart'; import '../profiler/cpu_profile_flame_chart.dart'; import '../profiler/cpu_profile_tables.dart'; @@ -28,12 +26,11 @@ class EventDetails extends CoreElement { // The size of the event details section will change as the splitter is // is moved. Observe resizing so that we can rebuild the flame chart canvas // as necessary. - // TODO(kenzie): clean this code up when - // https://github.com/dart-lang/html/issues/104 is fixed. - final observer = - html.ResizeObserver(allowInterop((List entries, _) { + // TODO(jacobr): Change argument type when + // https://github.com/dart-lang/sdk/issues/36798 is fixed. + final observer = html.ResizeObserver((List entries, _) { cpuProfiler.flameChart.updateForContainerResize(); - })); + }); observer.observe(element); assert(tabNav != null); diff --git a/packages/devtools/lib/src/timeline/timeline_screen.dart b/packages/devtools/lib/src/timeline/timeline_screen.dart index f468f6ddf28..ea9e9ede94a 100644 --- a/packages/devtools/lib/src/timeline/timeline_screen.dart +++ b/packages/devtools/lib/src/timeline/timeline_screen.dart @@ -6,7 +6,6 @@ import 'dart:convert'; import 'dart:html' as html; import 'dart:math' as math; -import 'package:js/js.dart'; import 'package:meta/meta.dart'; import 'package:split/split.dart' as split; @@ -274,10 +273,9 @@ class TimelineScreen extends Screen { // The size of [flameChartContainer] will change as the splitter moved. // Observe resizing so that we can rebuild the flame chart canvas as // necessary. - // TODO(kenzie): clean this code up when - // https://github.com/dart-lang/html/issues/104 is fixed. - final observer = - html.ResizeObserver(allowInterop((List entries, _) { + // TODO(jacobr): Change argument type when + // https://github.com/dart-lang/sdk/issues/36798 is fixed. + final observer = html.ResizeObserver((List entries, _) { // TODO(kenzie): observe resizing for recordedTimeline as well. Recorded // timeline will not have a selected frame. if (flameChartCanvas == null || @@ -300,7 +298,7 @@ class TimelineScreen extends Screen { TimelineFlameChartCanvas.sectionSpacing, ), ); - })); + }); observer.observe(flameChartContainer.element); } diff --git a/packages/devtools/lib/src/ui/viewport_canvas.dart b/packages/devtools/lib/src/ui/viewport_canvas.dart index 9d8ea0e3431..416beef41bf 100644 --- a/packages/devtools/lib/src/ui/viewport_canvas.dart +++ b/packages/devtools/lib/src/ui/viewport_canvas.dart @@ -3,7 +3,6 @@ // found in the LICENSE file. import 'dart:html' hide VoidCallback; -import 'dart:js'; import 'package:meta/meta.dart'; @@ -169,11 +168,11 @@ class ViewportCanvas extends Object with SetStateMixin { ..overflow = 'hidden'; _element.add(_content); - // TODO(jacobr): clean this code up when - // https://github.com/dart-lang/html/issues/104 is fixed. - _resizeObserver = ResizeObserver(allowInterop((List entries, _) { + // TODO(jacobr): Change argument type when + // https://github.com/dart-lang/sdk/issues/36798 is fixed. + _resizeObserver = ResizeObserver((List entries, _) { _scheduleRebuild(); - })); + }); _resizeObserver.observe(_element.element); element.onScroll.listen((_) {