Search packages, repositories and app categories

Package detailsv0.5.0

responsive_layout_builder

Flutter package for building responsive layout based on screen sizes and orientation. It could be wristwatch, small/medium/large mobile, small/large tablet or desktop.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
139
Likes
24
Pub points
140

Install package

flutter pub add responsive_layout_builder

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that simplifies creating responsive layouts by detecting screen size and orientation across devices, including wristwatches, mobiles, tablets, and desktops. It provides a clean API to adapt UI components dynamically based on the current device's characteristics, ensuring consistent user experiences across diverse form factors. The package is ideal for developers aiming to build flexible, scalable interfaces without writing repetitive media query logic.

Use cases

  • Adapting UI for different screen sizes
  • Building cross-platform apps with consistent design
  • Creating layouts for watches and tablets
  • Responsive design without manual media queries
  • Optimizing layouts for desktop and mobile
  • Supporting multiple device orientations

Key features

  • Automatic screen size detection
  • Orientation-aware layout adjustments
  • Support for watches, mobiles, tablets, and desktops
  • Simple, declarative API
  • Built-in breakpoints for common devices
  • Cross-platform compatibility

Suitable for

  • Developers building multi-device apps
  • Teams prioritizing responsive design
  • Projects requiring adaptive UIs
  • Flutter beginners learning responsive layouts
  • Apps targeting both mobile and desktop users
  • Projects with complex layout requirements

Considerations

  • May require testing on multiple device types
  • Breakpoints are predefined and not fully customizable
  • Performance impact on very frequent rebuilds
  • Limited to screen size and orientation detection
  • Does not handle dynamic content resizing
  • Best used with state management for complex layouts

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

responsive_layout_builder

Flutter package for building responsive layout based on screen sizes and orientation. It could be wristwatch, small/medium/large mobile, small/large tablet or desktop.

Getting Started

Widget approach

ResponsiveLayoutBuilder could be used as usual widget builder such as LayoutBuilder or OrientationBuilder, etc.

ResponsiveLayoutBuilder(
    builder: (context, screenSize) {
        // Use size argument to build size dependent widgets
    },
),

size property within screenSize stores LayoutSize which could be watch, mobile, tablet, desktop or tv.

mobile property within screenSize stores MobileLayoutSize which could be small, medium or large.

tablet property within screenSize stores TabletLayoutSize which could be small or large.

Functional approach

For using functional approach to retrieve current size use following:

// for getting mobile layout size 
getMobileLayoutSize(width: MediaQuery.of(context).size.width);

// for getting tablet layout size 
getTabletLayoutSize(width: MediaQuery.of(context).size.width);

// for getting screen size based on width
getScreenSize(width: MediaQuery.of(context).size.width);

// for getting screen size based on context 
getContextualScreenSize(context: context);

If you need to specify ScreenSizeSettings for all above functions sizes argument is needed to be passed, like this:

sizes: ScreenSizeSettings(...)

For getScreenSize and getContextualScreenSize could be specified also orientation and defaultSize.

TODO

  • Figure out how to determine TV
  • Add tests

Categories

Dependencies

Dependency list 1 items

  • pedantic^1.11.0

Source repository

Projects using this package

No data available yet.