From 4452bd0a6bf3fb3590072926797e31c9d17024b0 Mon Sep 17 00:00:00 2001 From: Yegor Date: Thu, 25 Oct 2018 09:56:23 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"Revert=20"make=20LocalHistoryRoute=20?= =?UTF-8?q?a=20proper=20super-mixin=20(#23382)"=E2=80=A6=20(#23482)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "Revert "make LocalHistoryRoute a proper super-mixin (#23382)" (#23430)" This reverts commit 3bbb3082b89ada4b0c44396148f3c2de731d1c6d. This relands the LocalHistoryRoute change. The analyzer bug has been fixed. * mark dartdocs as flaky --- dev/devicelab/manifest.yaml | 1 + packages/flutter/lib/src/widgets/routes.dart | 8 +++----- packages/flutter/test/widgets/routes_test.dart | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dev/devicelab/manifest.yaml b/dev/devicelab/manifest.yaml index 45a342bd75..58e1300ee3 100644 --- a/dev/devicelab/manifest.yaml +++ b/dev/devicelab/manifest.yaml @@ -459,6 +459,7 @@ tasks: Tracks how many members are still lacking documentation. stage: devicelab required_agent_capabilities: ["linux/android"] + flaky: true flutter_test_performance: description: > diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 9da5253da1..c885ae0ade 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -306,16 +306,14 @@ class LocalHistoryEntry { } } -/// A route that can handle back navigations internally by popping a list. +/// A mixin used by routes to handle back navigations internally by popping a list. /// /// When a [Navigator] is instructed to pop, the current route is given an -/// opportunity to handle the pop internally. A LocalHistoryRoute handles the +/// opportunity to handle the pop internally. A `LocalHistoryRoute` handles the /// pop internally if its list of local history entries is non-empty. Rather /// than being removed as the current route, the most recent [LocalHistoryEntry] /// is removed from the list and its [LocalHistoryEntry.onRemove] is called. -/// -/// This class is typically used as a mixin. -abstract class LocalHistoryRoute extends Route { +mixin LocalHistoryRoute on Route { List _localHistory; /// Adds a local history entry to this route. diff --git a/packages/flutter/test/widgets/routes_test.dart b/packages/flutter/test/widgets/routes_test.dart index 14d3e11ee1..2d8e784a60 100644 --- a/packages/flutter/test/widgets/routes_test.dart +++ b/packages/flutter/test/widgets/routes_test.dart @@ -12,7 +12,7 @@ final List results = []; Set routes = HashSet(); -class TestRoute extends LocalHistoryRoute { +class TestRoute extends Route with LocalHistoryRoute { TestRoute(this.name); final String name;