Skip to content

Commit f1f46ef

Browse files
authored
Revert "PlatformRouteInformationProvider should dispatch creation in constructor." (#133479)
Reverts flutter/flutter#133353 Tree is failing on Mac and Linux customer_testing on this PR. https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20customer_testing/14646/overview https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20customer_testing/14974/overview
1 parent 76d6d36 commit f1f46ef

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

packages/flutter/lib/src/widgets/router.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,11 +1465,7 @@ class PlatformRouteInformationProvider extends RouteInformationProvider with Wid
14651465
/// provider.
14661466
PlatformRouteInformationProvider({
14671467
required RouteInformation initialRouteInformation,
1468-
}) : _value = initialRouteInformation {
1469-
if (kFlutterMemoryAllocationsEnabled) {
1470-
maybeDispatchObjectCreation();
1471-
}
1472-
}
1468+
}) : _value = initialRouteInformation;
14731469

14741470
static bool _equals(Uri a, Uri b) {
14751471
return a.path == b.path

packages/flutter/test/material/app_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,6 @@ void main() {
11611161
routerDelegate: delegate,
11621162
));
11631163
expect(tester.takeException(), isAssertionError);
1164-
provider.dispose();
11651164
});
11661165

11671166
testWidgetsWithLeakTracking('MaterialApp.router throw if route configuration is provided along with other delegate', (WidgetTester tester) async {

packages/flutter/test/widgets/router_test.dart

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,21 +1582,6 @@ testWidgets('ChildBackButtonDispatcher take priority recursively', (WidgetTester
15821582
expect(info2.location, '/abc?def=ghi&def=jkl#mno');
15831583
});
15841584
});
1585-
1586-
test('$PlatformRouteInformationProvider dispatches object creation in constructor', () {
1587-
int eventCount = 0;
1588-
void listener(ObjectEvent event) => eventCount++;
1589-
MemoryAllocations.instance.addListener(listener);
1590-
1591-
final PlatformRouteInformationProvider registry = PlatformRouteInformationProvider(
1592-
initialRouteInformation: RouteInformation(uri: Uri.parse('http://google.com')),
1593-
);
1594-
1595-
expect(eventCount, 1);
1596-
1597-
registry.dispose();
1598-
MemoryAllocations.instance.removeListener(listener);
1599-
});
16001585
}
16011586

16021587
Widget buildBoilerPlate(Widget child) {

0 commit comments

Comments
 (0)