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;