flutter_resizer 0.0.1 copy "flutter_resizer: ^0.0.1" to clipboard
flutter_resizer: ^0.0.1 copied to clipboard

Flutter Resizer is a lightweight and efficient package for handling responsive UI scaling in Flutter applications. It simplifies adapting text sizes, widths, heights, and pixel ratios dynamically ba [...]

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    SizeConfig.init(context);
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Container(
                width: 100.w,
                height: 50.h,
                color: Colors.blue,
                child: Center(
                  child: Text(
                    'Hello',
                    style: TextStyle(fontSize: 16.sp),
                  ),
                ),
              ),
              20.height, // Use 20.height instead of SizedBox(height: 20.h)
              if (SizeConfig.isSmallScreen)
                const Text('This is a small screen'),
              if (SizeConfig.isMediumScreen)
                const Text('This is a medium screen'),
              if (SizeConfig.isLargeScreen)
                const Text('This is a large screen'),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
130
points
16
downloads

Publisher

verified publisherrajasabiq.com

Weekly Downloads

Flutter Resizer is a lightweight and efficient package for handling responsive UI scaling in Flutter applications. It simplifies adapting text sizes, widths, heights, and pixel ratios dynamically based on different screen sizes and devices. With built-in extension methods, it offers an easy way to make your UI fully responsive.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_resizer