From 5ee8b276b08f5478f7384f8f4a1eb4647e6e959c Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:11:27 -0700 Subject: [PATCH 1/5] Update widget_test.dart LayoutBuilder migration: LayoutBuilders no longer do double layout (currently the fix is behind a temporary flag). Related flutter/flutter PR: https://github.com/flutter/flutter/pull/147856 --- test/widget_test.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index 6a6b935..12fbba0 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -42,6 +42,8 @@ Future fetchFont() async { Future main() async { final fontLoader = FontLoader('Roboto')..addFont(fetchFont()); await fontLoader.load(); + setUp(() { LayoutBuilder.applyDoubleRebuildFix = true; }); + tearDown(() { LayoutBuilder.applyDoubleRebuildFix = false; }); testWidgets('can optionally delay close with a Duration', (tester) async { await tester.pumpWidget( @@ -1365,7 +1367,7 @@ Future main() async { expect(find.text('1'), findsOneWidget); expect(find.text('1 1'), findsOneWidget); expect(entryBuild.calls, - const [EntryBuildSpyCall(0, 1), EntryBuildSpyCall(1, 1)]); + const [EntryBuildSpyCall(1, 1)]); }); testWidgets('layout builder between portal and entry on first build', From 3416cfab238b4de614dea0b213109dbfc0256f50 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:19:46 -0700 Subject: [PATCH 2/5] Update widget_test.dart --- test/widget_test.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index 12fbba0..e026396 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -42,8 +42,6 @@ Future fetchFont() async { Future main() async { final fontLoader = FontLoader('Roboto')..addFont(fetchFont()); await fontLoader.load(); - setUp(() { LayoutBuilder.applyDoubleRebuildFix = true; }); - tearDown(() { LayoutBuilder.applyDoubleRebuildFix = false; }); testWidgets('can optionally delay close with a Duration', (tester) async { await tester.pumpWidget( @@ -1366,8 +1364,6 @@ Future main() async { expect(find.text('1'), findsOneWidget); expect(find.text('1 1'), findsOneWidget); - expect(entryBuild.calls, - const [EntryBuildSpyCall(1, 1)]); }); testWidgets('layout builder between portal and entry on first build', From 5cb02be83504d9f47b3f83145f079cba5d78f026 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:01:47 -0700 Subject: [PATCH 3/5] Update widget_test.dart --- test/widget_test.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/widget_test.dart b/test/widget_test.dart index e026396..f928daf 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1364,6 +1364,9 @@ Future main() async { expect(find.text('1'), findsOneWidget); expect(find.text('1 1'), findsOneWidget); + // https://github.com/fzyzcjy/flutter_portal/pull/113. + //expect(entryBuild.calls, + //const [EntryBuildSpyCall(0, 1), EntryBuildSpyCall(1, 1)]); }); testWidgets('layout builder between portal and entry on first build', From fefd22d3beb0ae818564b20a031a6a9c4305e5f8 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Mon, 3 Jun 2024 17:36:27 -0700 Subject: [PATCH 4/5] Update widget_test.dart --- test/widget_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index f928daf..162a93c 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1365,8 +1365,7 @@ Future main() async { expect(find.text('1'), findsOneWidget); expect(find.text('1 1'), findsOneWidget); // https://github.com/fzyzcjy/flutter_portal/pull/113. - //expect(entryBuild.calls, - //const [EntryBuildSpyCall(0, 1), EntryBuildSpyCall(1, 1)]); + // expect(entryBuild.calls, const [EntryBuildSpyCall(0, 1), EntryBuildSpyCall(1, 1)]); }); testWidgets('layout builder between portal and entry on first build', From 53e9cccc560d6cd9fbdec9e26e22425b1a835537 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:03:56 -0700 Subject: [PATCH 5/5] Update widget_test.dart --- test/widget_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index 162a93c..1c696c4 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -1365,7 +1365,7 @@ Future main() async { expect(find.text('1'), findsOneWidget); expect(find.text('1 1'), findsOneWidget); // https://github.com/fzyzcjy/flutter_portal/pull/113. - // expect(entryBuild.calls, const [EntryBuildSpyCall(0, 1), EntryBuildSpyCall(1, 1)]); + // expect(entryBuild.calls, const [EntryBuildSpyCall(0, 1), EntryBuildSpyCall(1, 1)]); }); testWidgets('layout builder between portal and entry on first build',