Search packages, repositories and app categories

Package detailsv1.0.6+4

the_responsive_builder

This flutter package provides a set of utilities to aid in building responsive Flutter applications.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
16
Likes
16
Pub points
140

Install package

flutter pub add the_responsive_builder

Package Overview

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

The Responsive Builder is a Flutter package designed to simplify the creation of responsive user interfaces across multiple platforms. It offers utility functions and widgets that adapt layout and styling based on screen size, device type, and orientation. By leveraging breakpoints and flexible constraints, developers can build UIs that dynamically adjust to various devices without writing repetitive conditional logic. Ideal for apps targeting Android, iOS, Web, macOS, Windows, and Linux, it streamlines responsive design workflows.

Use cases

  • Building cross-platform responsive layouts
  • Adapting UIs to different screen sizes
  • Creating adaptive designs for web and mobile
  • Simplifying breakpoint-based styling
  • Supporting multi-device app development

Key features

  • Breakpoint-based responsive logic
  • Cross-platform compatibility
  • Flexible widget utilities
  • Auto-adjusting layouts
  • Minimal boilerplate code

Suitable for

  • Developers building multi-platform apps
  • Teams prioritizing responsive design
  • Projects requiring dynamic UI adaptation
  • Flutter beginners learning responsive patterns
  • Apps targeting diverse device ecosystems

Considerations

  • May require understanding of responsive design principles
  • Limited customization for complex layouts
  • Depends on consistent use of breakpoints
  • Best suited for standard responsive needs
  • Not ideal for highly dynamic or non-linear layouts

Original README

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

Pub

The Responsive Builder

This package provides a set of utilities to aid in building responsive Flutter applications that adapt to different screen sizes and orientations.

1. Setup

Firstly, add package to pubspec.yaml.

Then, wrap your main MaterialApp widget with the TheResponsiveBuilder

void main() => runApp(
  TheResponsiveBuilder(
    builder: (context, orientation, screenType) {
      return MaterialApp(
        //... your other MaterialApp properties
      );
    },
  ),
);
2. Usage of extensions

With the utilities set up, you can easily use the extensions provided:

- Height & Width
// This will set the height to 20% of the screen height
Container(height: 20.h, ...);

// This will set the width to 50% of the screen width
Container(width: 50.w, ...);
- Density Pixels & Scaled Pixels
// This uses a logarithmic formula to scale UI elements based on screen size and pixel density.
TextStyle(fontSize: 16.dp, ...);

// This scales the text size based on the user's font size settings.
TextStyle(fontSize: 16.sp, ...);
- Screen Type & Orientation
if (context.screenType == ScreenType.mobile) {
  // Build UI for mobile
} else {
  // Build UI for tablet
}

if (context.orientation == Orientation.portrait) {
  // Build UI for portrait mode
} else {
  // Build UI for landscape mode
}
- Lock & Unlock Screen Orientation
// Lock screen orientation to Portrait mode
context.lockToPortrait();

// Lock screen orientation to Landscape mode
context.lockToLandscape();

// Unlock screen orientation to automatic mode
context.unlockOrientation();

Categories

Source repository

Projects using this package

No data available yet.