You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Would like an example of testing for Landscape in a widget test #10307
@sethladd asked me how difficult it was to test landscape layouts in tests. I suspect it's straightforward to do, but I'm not aware of an example to give.
It seems like we will want to explain to individuals in flutter.io/testing how to test landscape vs. portrait for their widgets (as well as layouts at different sizes). For our own widgets, coverage will tell us if we're testing the landscape vs. portrait configurations of course. e.g. https://coveralls.io/builds/11679479/source?filename=lib%2Fsrc%2Fmaterial%2Fdate_picker.dart#L101 (I'm not actually sure if that's telling me the portrait code is covered or not).
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Hixie commentedon May 25, 2017
In practice all tests are landscape. :-)
eseidelGoogle commentedon May 25, 2017
It seems like we will want to explain to individuals in flutter.io/testing how to test landscape vs. portrait for their widgets (as well as layouts at different sizes). For our own widgets, coverage will tell us if we're testing the landscape vs. portrait configurations of course. e.g. https://coveralls.io/builds/11679479/source?filename=lib%2Fsrc%2Fmaterial%2Fdate_picker.dart#L101 (I'm not actually sure if that's telling me the portrait code is covered or not).
Hixie commentedon May 25, 2017
Indeed. Where's a good place to put this information? API docs? Where?
eseidelGoogle commentedon May 25, 2017
Presumably https://flutter.io/testing?
zoechi commentedon Jun 27, 2018
Related SO question https://stackoverflow.com/questions/50158364/in-flutter-widget-testing-how-to-make-media-orientation-to-portrait
zoechi commentedon Dec 11, 2018
Probably a better way (not tested, wasn't aware of that before) https://stackoverflow.com/questions/53706569/how-to-test-flutter-widgets-on-different-screen-sizes
zoechi commentedon Dec 11, 2018
Issue moved to flutter/website #2005 via ZenHub
eggenstein commentedon Mar 27, 2019
This works just fine for me:
github-actions commentedon Aug 15, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.