Optimize Overlay sample to avoid overflow (#155861)
Fixes [Optimize official `Overlay` sample to avoid overflowing.](https://github.com/flutter/flutter/issues/155860) When checking https://main-api.flutter.dev/flutter/widgets/Overlay-class.html on a laptop screen it overflows as the layout uses Row instead of more robust widget for spacing `Wrap` Quick Friday night fix. :) | Before | After | | --------------- | --------------- | | <img src="https://github.com/user-attachments/assets/eea6f1d9-e860-4ebd-8d16-2d8f4141e1ec" /> | <img src="https://github.com/user-attachments/assets/9f8426ba-d541-44a6-8ea6-2e34636b7e82" /> |
This commit is contained in:
@@ -38,4 +38,19 @@ void main() {
|
||||
expect(find.text(commutePage), findsNothing);
|
||||
expect(find.text(savedPage), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('Narrow layout does not overflow', (WidgetTester tester) async {
|
||||
// Set a narrow screen size.
|
||||
tester.view
|
||||
..physicalSize = const Size(320, 480)
|
||||
..devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
|
||||
await tester.pumpWidget(
|
||||
const example.OverlayApp(),
|
||||
);
|
||||
|
||||
// Verify that no overflow errors occur.
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user