Skip to content
pubscout

responsiveness

1.2.8, released 3 years ago by digital-confidence.de

Minimal responsive framework using Bootstrap breakpoints by default with optional code generation.

WASM-ready
$ flutter pub add responsiveness
Source repository

What it does

Provides widgets and utilities like ResponsiveValue, ResponsiveChild, and ResponsiveParent to build screen-size-aware UIs. It supports Bootstrap breakpoints out of the box and allows custom breakpoints through code generation.

AI-written summary of version 1.2.8, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want a minimal responsive framework based on Bootstrap breakpoints
  • You need to adapt widget properties, children, or wrapping widgets based on screen width
  • You want to define custom breakpoints using a JSON file and code generation

Skip it when

  • You need complex navigation-level adaptive layouts that aren't covered by basic width checks
  • You prefer heavy platform-adaptive widget libraries

Strengths

  • Easy to use with straightforward widgets like ResponsiveValue and ResponsiveChild
  • Supports custom breakpoints via a screen_sizes.json file and code generation
  • Falls back to the nearest smaller defined screen size automatically

Weaknesses

  • Relies on a custom code generation script (`dart run responsiveness`) rather than standard build_runner if using custom breakpoints
  • Limited to width-based breakpoints

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

To use custom breakpoints, create a screen_sizes.json file at the root of the project and run `dart run responsiveness`.

static const fontSize = ResponsiveValue<double>(xs: 20.0, sm: 21.0, md: 22.0);

@override
Widget build(BuildContext context) {
  return Text(
    "Hello World",
    style: TextStyle(fontSize: fontSize.of(context)),
  );
}

Alternatives

Packages that do the same job and could replace responsiveness.

  • responsive_framework

    More feature-rich framework for scaling and handling responsive layouts across different screen sizes.

  • responsive_builder

    Popular alternative for building responsive UIs using widget builders for different screen types.

  • sizer

    Alternative approach focusing on sizing widgets and fonts dynamically based on screen dimensions.