From 9bc85d7e54a0896ba5ea1635c52aeb73667dd7a2 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 25 Mar 2019 09:42:57 -0700 Subject: [PATCH] wrap Timeline calls in assert (#29861) --- packages/flutter/lib/src/material/about.dart | 25 ++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 6a48587c55..787702a30f 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -380,18 +380,26 @@ class _LicensePageState extends State { bool _loaded = false; Future _initLicenses() async { - final Flow flow = Flow.begin(); - Timeline.timeSync('_initLicenses()', () { }, flow: flow); + int debugFlowId = -1; + assert(() { + final Flow flow = Flow.begin(); + Timeline.timeSync('_initLicenses()', () { }, flow: flow); + debugFlowId = flow.id; + return true; + }()); await for (LicenseEntry license in LicenseRegistry.licenses) { - if (!mounted) + if (!mounted) { return; - Timeline.timeSync('_initLicenses()', () { }, flow: Flow.step(flow.id)); + } + assert(() { + Timeline.timeSync('_initLicenses()', () { }, flow: Flow.step(debugFlowId)); + return true; + }()); final List paragraphs = await SchedulerBinding.instance.scheduleTask>( - () => license.paragraphs.toList(), + license.paragraphs.toList, Priority.animation, debugLabel: 'License', - flow: flow, ); setState(() { _licenses.add(const Padding( @@ -434,7 +442,10 @@ class _LicensePageState extends State { setState(() { _loaded = true; }); - Timeline.timeSync('Build scheduled', () { }, flow: Flow.end(flow.id)); + assert(() { + Timeline.timeSync('Build scheduled', () { }, flow: Flow.end(debugFlowId)); + return true; + }()); } @override