flutter_ui_scaler 0.1.0 copy "flutter_ui_scaler: ^0.1.0" to clipboard
flutter_ui_scaler: ^0.1.0 copied to clipboard

Flutter UI scaler that matches a Figma frame across devices and orientations. Orientation-aware size/font scaling with sensible clamps.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_ui_scaler/flutter_ui_scaler.dart';

void main() => runApp(const Demo());

class Demo extends StatelessWidget {
  const Demo({super.key});

  @override
  Widget build(BuildContext context) {
    return UiScaleScope(
      figmaW: 440,
      figmaH: 956,
      child: MaterialApp(
        home: Scaffold(
          body: Center(
            child: Builder(
              builder: (ctx) {
                final ds = ctx.ds; // from UiScaleScope extension
                return Container(
                  padding: EdgeInsets.all(ds.sx(24)),
                  decoration: BoxDecoration(
                    color: Colors.blue.shade50,
                    borderRadius: BorderRadius.circular(ds.sx(20)),
                  ),
                  child: Text(
                    'Hello scaled world',
                    style: TextStyle(fontSize: ds.sp(20)),
                  ),
                );
              },
            ),
          ),
        ),
      ),
    );
  }
}
3
likes
0
points
110
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter UI scaler that matches a Figma frame across devices and orientations. Orientation-aware size/font scaling with sensible clamps.

Repository (GitHub)
View/report issues

Topics

#flutter #responsive #layout #scaling #typography

License

unknown (license)

Dependencies

args, flutter, meta

More

Packages that depend on flutter_ui_scaler