Flutter · One codebase, native feel

How do you build responsive and adaptive Flutter layouts?

MediumresponsivelayoutbuilderadaptivebreakpointsUpdated Oct 2026
Quiz this track

Short answer

Use LayoutBuilder and MediaQuery for available space, then switch structure at breakpoints. Responsive changes layout for screen size; adaptive also changes behaviour and controls per platform.

Responsive design reacts to available space, not to a device name. LayoutBuilder gives the constraints of the current box, which is more reliable than MediaQuery when a widget sits in a split view or a resizable window. MediaQuery is still useful for text scale, safe areas and orientation.

dart
class Dashboard extends StatelessWidget {
  const Dashboard({super.key});

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (context, constraints) {
        final wide = constraints.maxWidth >= 840;
        if (wide) {
          return Row(
            children: [
              const NavigationRail(
                destinations: [
                  NavigationRailDestination(
                    icon: Icon(Icons.home),
                    label: Text('Home'),
                  ),
                ],
              ),
              const Expanded(child: Feed()),
            ],
          );
        }
        return const Feed();
      },
    );
  }
}
  • Use breakpoints from the design system rather than arbitrary pixel guesses
  • Prefer LayoutBuilder for component-level decisions and MediaQuery for global context
  • Respect text scaling and test at large accessibility font sizes
  • Use SafeArea for notches, status bars and gesture insets
  • On desktop and web, support mouse, keyboard and window resizing

Responsive versus adaptive

A responsive layout rearranges the same widgets for a narrower width. An adaptive app also changes interaction details: a date picker might become a dialog on desktop and a bottom sheet on mobile, or navigation might become a rail on tablets. Both should be driven by explicit constraints and platform capabilities.

Do not hardcode device widths like 375 or 414. Widgets must work at any width, including split screen, foldables and web windows.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1Why is LayoutBuilder usually better than MediaQuery for components?
  2. 2How do you test a layout at multiple widths?
  3. 3What breaks when the user increases text scale?
  4. 4How would you adapt navigation for tablets and desktop?

Say it in the interview

I build responsive layouts from available constraints rather than device names. LayoutBuilder tells a component how much space it actually has, and I switch structure at breakpoints from the design system. MediaQuery still handles safe areas, orientation and text scale. Adaptive goes further by changing platform-specific controls and interactions, not just column counts.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Flutter mock interview and get scored feedback on depth, clarity and confidence.