Flutter - How To Show Different Content Based On Device Orientation (Portrait or Landscape Mode)

Pubblicato il: 03 giugno 2021
sul canale di: Flutter Mentor
3,100
52

If you allow your app to have both portrait and landscape displays, then you better prepare your code for when your users want to use the least commonly used display.

Most apps are made for portrait mode for obvious reasons. So, it's only natural that some apps don't look as good when used in portrait mode. However, using what I show in this video, you can even create an entire app version based on one display orientation, and another for the other display orientation.

All you need to do is always know what orientation is the app user is on. That's it! And that's exactly what I show you how to find out.

00:00 - Intro
01:00 - Code Overview
01:25 - Using MediaQuery.of(context).orientation
02:30 - Using Ternary Operator
03:10 - Seeing It Work
03:40 - Alternative Code Options
04:20 - Like & Subscribe
04:34 - Flutter Mentor Out

#flutter #deviceorientation #portraitandlandscapemode

Credits:

OUTRO SONG:
Mitsubachi by Smith The Mister https://smiththemister.bandcamp.com
Smith The Mister https://bit.ly/Smith-The-Mister-YT
Free Download / Stream: http://bit.ly/mitsubachi
Music promoted by Audio Library    • Mitsubachi – Smith The Mister (No Copyrigh...  


In questa pagina del sito puoi guardare il video online Flutter - How To Show Different Content Based On Device Orientation (Portrait or Landscape Mode) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Flutter Mentor 03 giugno 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 3,100 volte e gli è piaciuto 52 spettatori. Buona visione!