Тёмный

LayoutBuilder and MediaQuerys - Flutter Explained 

Flutter Explained
Подписаться 38 тыс.
Просмотров 16 тыс.
50% 1

Опубликовано:

 

25 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 28   
@nagarajjayabalan5032
@nagarajjayabalan5032 4 года назад
Well explained with examples. Clear voice. Thank your for this great video.
@piiaall
@piiaall 4 года назад
Nicely explained.. 👌
@sagarshah440
@sagarshah440 3 года назад
Ohh thank you so much for this video
@FlutterExplained
@FlutterExplained 3 года назад
You are most welcome :)
@gamekonet
@gamekonet 4 года назад
amazing work and explanation, keep it up and best of luck
@FlutterExplained
@FlutterExplained 4 года назад
Thanks, will do!
@tessertaha
@tessertaha 4 года назад
Great video, keep it up!
@FlutterExplained
@FlutterExplained 4 года назад
Thanks for your support! I will give my best :).
@darshang7133
@darshang7133 3 года назад
Hey, thank you for this great tutorial. It helped me a lot
@ahmadramadan9806
@ahmadramadan9806 10 месяцев назад
Hello, your code about MediaQuery gave me an error "No MediaQuery widget ancestor found.", what is the reason for that
@barsidemen5208
@barsidemen5208 4 года назад
Thank you, just a quick question regarding the orientation depending on the ternary in Scaffold. As HomeScreen widget is a stateless widget, how does it re-render when the device is switched from portrait to landscape?
@FlutterExplained
@FlutterExplained 4 года назад
That is related to the underling implementation of MediaQuery.of it uses the build method where it is inside as a reference (thanks to MediaQuery.of(context) it knows exactly in which widget it is inside. Therefore it can retrigger the rebuild as soon as it understands the changes. In the API it is not fully explained but you see that it is created with the intention that it triggers the rebuild. api.flutter.dev/flutter/widgets/MediaQuery-class.html I hope that helps :)
@barsidemen5208
@barsidemen5208 4 года назад
@@FlutterExplained Thanks, it does indeed. So, MediaQuery should be used with caution to prevent unnecessary rebuilds.
@mohamedelyamani7845
@mohamedelyamani7845 3 года назад
How can we apply this on bigger app structure with complex widgets I can't duplicate the views one for portirat and one for landscape for the whole app widgets
@FlutterExplained
@FlutterExplained 3 года назад
That is a really good point, in some of my Live Streams I started by creating a "Responsive Widget" which allowed me to initialize it for 3 different screen sizes, with that I was able to use the same widgets with different information. FilledStacks created a fantastic series already with mutliple ways on how to implement a Responsive Architecture, maybe this will guide you along the way. www.filledstacks.com/tag/Responsive%20UI/
@mohamedelyamani7845
@mohamedelyamani7845 3 года назад
Thank you so much I already saw 3 videos I will follow his instructions
@FlutterExplained
@FlutterExplained 3 года назад
@@mohamedelyamani7845 Fantastic :) enjoy the journey!
@GhostNikki
@GhostNikki 4 года назад
1 question buddy. What does constrain width return does it return it's parent widget width or screen width ? If I have Container its width is 200 and child is layoutbuilder so constraints.maxwidth will be 200?
@FlutterExplained
@FlutterExplained 4 года назад
Hi Nikhil, yes exactly. The constraints take the width and height of its parent widget, which in your case will be the Container widget with width 200.
@zukikazumi8965
@zukikazumi8965 4 года назад
thank u sir
@FlutterExplained
@FlutterExplained 4 года назад
You are most welcome :)
@kaivalpatel3990
@kaivalpatel3990 4 года назад
Sir, So for like portrait and landscape we don't have any other class where it Automatically set the 5 cards with best fit? It would be hectic to design portrait and landscape for every Screen! Love from India!!
@FlutterExplained
@FlutterExplained 4 года назад
Good point unfortunately this is how flutter works I use in the Flutter website a Responsive Widget to make it possible to use the right widget depending on the situation.
@davidwhitaker6489
@davidwhitaker6489 3 года назад
Keep in mind everything in flutter can run in web so it will have some sort of common widget for things you'd like to do. Check out the flexible widget.
@coolprashantmailbox
@coolprashantmailbox 4 года назад
When should we use MediaQuery and LayoutBuilder in a screen
@FlutterExplained
@FlutterExplained 4 года назад
Hi Prashant Kumar, thanks for the question. The MediaQuery contains valuable information about the Orientation and the ScreenSize, and if you use the MediaQuery.of method, it retriggers the build method automatically again. Also, the MediaQuery can distinguish without returning a widget and, you can change only properties of font sizes. api.flutter.dev/flutter/widgets/MediaQuery-class.html The LayoutBuilder gives us additionally the BoxConstraints of the Widget it lives inside. Additionally, the LayoutBuilder needs necessarily to return a widget. api.flutter.dev/flutter/widgets/LayoutBuilder-class.html I hope that solved your question if not please feel free to DM me and I will try to give you a better explanation.
@Сова32
@Сова32 4 года назад
I made this differently SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown ]); but I like your solution more, so I have to remake mine, thanks
@FlutterExplained
@FlutterExplained 4 года назад
I did it before I discovered the Media Queries orientation exactly in the same way :). It is easier to prototype I guess.
Далее
The Best Flutter Responsive UI Setup
13:11
Просмотров 87 тыс.
Flutter Layouts for the CSS Developer
10:24
Просмотров 71 тыс.
Flutter Responsive UI | Learning Platform App - Part 1
44:44
Top 10 Widgets every Flutter Developer should know!
17:17
Responsive design with Flutter MediaQueries
7:20
Просмотров 24 тыс.
Top 30 Flutter Tips and Tricks
6:50
Просмотров 564 тыс.
Top 35 Flutter Widgets
29:29
Просмотров 328 тыс.
🖥📱RESPONSIVE DESIGN • Flutter Tutorial
8:03
Просмотров 293 тыс.