Skip to content
pubscout

pixel_snap

0.1.5, released 3 years ago by matejknopp.com

Sharp looking Flutter applications at any pixel scaling factor.

Single maintainer
$ flutter pub add pixel_snap
Source repository

What it does

Ensures Flutter applications render sharply on systems with non-integral pixel scaling (like Windows at 150%) by snapping sizes, paddings, and widget positions to physical pixel boundaries. It provides extension methods and drop-in widget replacements for basic and layout widgets.

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

Use it when

  • Building desktop applications, especially for Windows where non-integral scaling factors are common
  • Fixing blurry borders, lines, or text caused by fractional device pixel ratios

Skip it when

  • Using heavy arbitrary rotation or scale transforms throughout the UI layout

Strengths

  • Solves blurry rendering issues on non-integral pixel scaling factors
  • Provides drop-in replacements for standard Flutter widgets via custom imports
  • Includes extension methods for easily snapping numeric and layout values

Weaknesses

  • Requires using custom imports for standard widgets to fully automate pixel snapping
  • Arbitrary scale and rotation transforms can interfere with accurate pixel snapping

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Not documented

final ps = PixelSnap.of(context);
final width = 10.pixelSnap(ps);

Works with

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