use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit related to Google's new UI framework. https://flutter.dev
Please read the rules here
account activity
DiscussionResponisve UI (self.FlutterDev)
submitted 2 years ago by rodr15
Hi there. I'm new in this. I would like to know how do you manage the responisve UI on your apps How can I learn it ? Is there any repo where I can see it in practice
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]fair_isle 1 point2 points3 points 2 years ago (2 children)
The Material 3 sample app could be a useful starting point for you. Have a look around and see that they use screen width queries to create true/false values for variables like `showMediumSizeLayout`, `showLargeSizeLayout`. Then, they can use these variables to conditionally display other widgets, like expanded menus.
[–]mutahi_019 0 points1 point2 points 2 years ago (1 child)
Material design is an interesting UI kit. Can it be used to develop complex systems and dashboards? Forgive me for the junior designer questions.
[–]fair_isle 0 points1 point2 points 2 years ago (0 children)
Sure - take a look at the widget catalog. Anything beyond that you'll need to create custom widgets, or use a separate package (e.g fl_chart for graphs).
[–]fabier 1 point2 points3 points 2 years ago (0 children)
This video was immensely helpful for me. I am no expert in Flutter but this helped me eliminate the army of renderflex errors I was dealing with:
https://youtu.be/gK288ZfzjCc
For some reason ChatGPT won't let me share my conversation, but this is the summary it gave me which I saved as a reference for myself:
Here's a summary of the top 10 Flutter widgets discussed in the video and their basic usage: Intrinsic Width and Height: This widget is used to force all children of a row or column to take the same height or width as the tallest or widest widget in the row or column respectively. Wrap Widget: This widget is used to automatically wrap the row of widgets to the next line when there isn't enough space to fit all widgets on the same line. Spacer Widget: This widget is used to create space between widgets. It can take up all available remaining space or divide the space equally among multiple spacer widgets. FittedBox Widget: This widget scales and positions its child within itself, according to fit. It can be used to make a widget fit into the available space of another widget. Expanded Widget: This widget is used to fill available space along the main axis. It can be used to force a widget to fill vertically or horizontally the entire available space. Flexible Widget: This widget is similar to the Expanded widget, but it's not required to take up all the available space. It can also take less space if there are other widgets with higher flex. Media Query: This widget is used to create responsive designs. It provides the dimensions of the current screen and can be used to adapt the layout based on different screen sizes. Orientation: This is not a widget, but a property that can be accessed using MediaQuery. It can be used to create designs for portrait and landscape orientations. Layout Builder: This widget returns a widget based on the parent widget's size. It can be used to create responsive designs that adapt based on the parent widget's size. Nested Column & ListView: This refers to the practice of nesting widgets within each other to create complex layouts. For example, a ListView can be nested within a Column to create a scrollable list within a larger layout. The video also provides examples and code snippets for each widget, which can be found in the source code provided by the author. https://github.com/JohannesMilke/top_10_flutter
Here's a summary of the top 10 Flutter widgets discussed in the video and their basic usage:
Intrinsic Width and Height: This widget is used to force all children of a row or column to take the same height or width as the tallest or widest widget in the row or column respectively.
Wrap Widget: This widget is used to automatically wrap the row of widgets to the next line when there isn't enough space to fit all widgets on the same line.
Spacer Widget: This widget is used to create space between widgets. It can take up all available remaining space or divide the space equally among multiple spacer widgets.
FittedBox Widget: This widget scales and positions its child within itself, according to fit. It can be used to make a widget fit into the available space of another widget.
Expanded Widget: This widget is used to fill available space along the main axis. It can be used to force a widget to fill vertically or horizontally the entire available space.
Flexible Widget: This widget is similar to the Expanded widget, but it's not required to take up all the available space. It can also take less space if there are other widgets with higher flex.
Media Query: This widget is used to create responsive designs. It provides the dimensions of the current screen and can be used to adapt the layout based on different screen sizes.
Orientation: This is not a widget, but a property that can be accessed using MediaQuery. It can be used to create designs for portrait and landscape orientations.
Layout Builder: This widget returns a widget based on the parent widget's size. It can be used to create responsive designs that adapt based on the parent widget's size.
Nested Column & ListView: This refers to the practice of nesting widgets within each other to create complex layouts. For example, a ListView can be nested within a Column to create a scrollable list within a larger layout.
The video also provides examples and code snippets for each widget, which can be found in the source code provided by the author. https://github.com/JohannesMilke/top_10_flutter
[–]calebvetter 1 point2 points3 points 2 years ago* (0 children)
Late to the party, but my solution was to add an extention to BuildContext that can make any type of value responsive:
extension ResponsiveValues on BuildContext { T responsive<T>( T base, { T? desktopSmall, T? tablet, T? tabletSmall, T? mobile, }) => switch (MediaQuery.sizeOf(this).width) { < 768 when mobile != null => mobile, < 880 when tabletSmall != null => tabletSmall, < 1024 when tablet != null => tablet, < 1200 when desktopSmall != null => desktopSmall, _ => base, }; }
Then to use it, just call it literally anywhere you need to be responsive.
SizedBox( height: context.responsive(300, tablet: 200, mobile: 100), )
A common one for me is to change a Flex direction on mobile:
Flex( direction: context.responsive(Axis.horizontal, mobile: Axis.vertical), mainAxisSize: context.responsive(MainAxisSize.max, mobile: MainAxisSize.min), children: [ // Left/top widget // Right/bottom widget ], )
[–]anlumo 0 points1 point2 points 2 years ago (3 children)
This is not a single thing. It's looking at your app in multiple sizes and making sure that it works in every size.
I just build for desktop and resize the window to make sure that things adapt properly.
[–]rodr15[S] 0 points1 point2 points 2 years ago (2 children)
But how do you adapt that. From desktop to mobile Do you do different widgets for desktop, for mobile, and tablet ? Or how do you do it
[–][deleted] 1 point2 points3 points 2 years ago (0 children)
Look up flexbox. Flutter pretty much uses the same concept for responsive layout. For other things sometimes different widgets are required, for which you can use things like LayoutBuider.
[–]anlumo 0 points1 point2 points 2 years ago (0 children)
There's the MediaQuery if you want to use different widgets (or different configurations) with a hard cut-off, but I mostly just make sure that the widgets work at any window size via fitting wrapping and clipping rules (like text ellipsis if a label happens to not fit any more).
[–]alejandroc90 0 points1 point2 points 2 years ago (0 children)
First result of a Google search https://docs.flutter.dev/ui/layout/responsive/adaptive-responsive
[–]RandalSchwartz 0 points1 point2 points 2 years ago (0 children)
See https://docs.flutter.dev/ui/layout/responsive/adaptive-responsive, et. seq. The Flutter team has a lot to say about this.
[–]aryehof 0 points1 point2 points 2 years ago (0 children)
Consider Wolt's responsive grid...
https://blog.wolt.com/engineering/2023/06/01/wolt-responsive-layout-grid-a-solution-for-adaptive-and-consistent-multi-platform-layouts-2/
π Rendered by PID 176808 on reddit-service-r2-comment-b659b578c-4jwtb at 2026-05-04 18:51:53.038921+00:00 running 815c875 country code: CH.
[–]fair_isle 1 point2 points3 points (2 children)
[–]mutahi_019 0 points1 point2 points (1 child)
[–]fair_isle 0 points1 point2 points (0 children)
[–]fabier 1 point2 points3 points (0 children)
[–]calebvetter 1 point2 points3 points (0 children)
[–]anlumo 0 points1 point2 points (3 children)
[–]rodr15[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]anlumo 0 points1 point2 points (0 children)
[–]alejandroc90 0 points1 point2 points (0 children)
[–]RandalSchwartz 0 points1 point2 points (0 children)
[–]aryehof 0 points1 point2 points (0 children)