Skip to content
pubscout

sizer

3.1.3, released a year ago by technoprashant.me

Provides percentage‑based size extensions and device helpers for responsive Flutter UI.

WASM-ready
$ flutter pub add sizer
Source repository

What it does

Sizer wraps the app in a widget that exposes screen dimensions, orientation and type. It adds extension methods like .w, .h, .sp, .dp to calculate sizes as a percentage of the device screen.

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

Use it when

  • You need quick, percentage‑based sizing across mobile, web and desktop
  • You want a lightweight solution without a full layout system
  • You prefer using extension methods over custom MediaQuery code

Skip it when

  • You require complex breakpoint grids or advanced layout constraints
  • You need a theming or widget‑library solution rather than just sizing helpers

Strengths

  • Very easy to integrate – just wrap MaterialApp
  • Works on all Flutter platforms
  • Provides many unit conversions (cm, inches, etc.)

Weaknesses

  • Limited to simple percentage sizing, no built‑in breakpoint management
  • Relies on global Device object which may be less testable
  • No support for code‑generated responsive widgets

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:sizer/sizer.dart';

void main(){
  runApp(
    Sizer(
      builder:(context,orientation,screenType)=>MaterialApp(
        home: Scaffold(
          body: Center(
            child: Container(width: 50.w, height: 20.h, color: Colors.blue),
          ),
        ),
      ),
    ),
  );
}

Alternatives

Packages that do the same job and could replace sizer.

  • responsive_framework

    Offers a full breakpoint system, theming and adaptive widgets for more complex responsive designs

  • responsive_builder

    Provides builders and utilities for responsive layouts with fine‑grained control

  • scaled_app

    Scales UI based on design size, useful when you prefer scaling over percentage calculations