Skip to content
pubscout

layoutr

1.0.0, released 6 years ago by an unverified publisher

Utilities and resolvers for responsive layouts and type-safe spacings in Flutter.

WASM-ready
$ flutter pub add layoutr
Source repository

What it does

Provides layout resolvers for different breakpoints (such as common desktop/tablet/phone or granular sizes) and type-safe spacing enums with context extensions. It helps handle responsive use-cases with minimal verbosity using custom layout builders.

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

Use it when

  • You want to build responsive layouts with custom breakpoints based on max width constraints.
  • You need type-safe, consistent spacing across different device sizes in your application.

Skip it when

  • You prefer media-query based design systems without layout builders.
  • You already use a comprehensive alternative framework like responsive_framework.

Strengths

  • Reduces verbosity when writing responsive layout conditions.
  • Provides built-in resolvers like CommonLayout and GranularLayout.
  • Offers type-safe spacing utilities and context extensions.

Weaknesses

  • Requires wrapping your widget tree in custom resolver widgets.
  • Breakpoints are completely subjective and must be configured per project constraints.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
Widget build(BuildContext context) {
  final layout = context.commonLayout;
  final textTheme = Theme.of(context).textTheme;

  return layout.value(
    desktop: () => Text('Desktop layout', style: textTheme.headline1),
    phone: () => Text('Phone layout', style: textTheme.headline4),
  );
}

Alternatives

Packages that do the same job and could replace layoutr.

  • responsive_framework

    Provides a comprehensive set of widgets for auto-scaling and responsive grid layouts globally across the app.

  • responsive_builder

    Offers screen type layout builders and device screen type utilities out of the box.

  • sizer

    Allows scaling UI based on device screen size using percentage-based extensions.

Works with

Packages commonly used together with layoutr: ones it builds on, ones built on it, and its own family.