Skip to content

Commit

Permalink
Update widget_test.dart
Browse files Browse the repository at this point in the history
LayoutBuilder migration: LayoutBuilders no longer do double layout (currently the fix is behind a temporary flag).

Related flutter/flutter PR:  flutter/flutter#147856
  • Loading branch information
LongCatIsLooong authored Jun 3, 2024
1 parent 786cd79 commit 5ee8b27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Future<ByteData> fetchFont() async {
Future<void> 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(
Expand Down Expand Up @@ -1365,7 +1367,7 @@ Future<void> 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',
Expand Down

0 comments on commit 5ee8b27

Please sign in to comment.