responsive_spacing_v2 1.1.2 copy "responsive_spacing_v2: ^1.1.2" to clipboard
responsive_spacing_v2: ^1.1.2 copied to clipboard

A simple Flutter package to add responsive padding and margin widgets for consistent, adaptive spacing across different screen sizes.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Responsive Spacing Example"),
        ),
        body: Column(
          children: [
            ResponsivePadding(
              smallScreenPadding: 8.0,
              largeScreenPadding: 16.0,
              child: Container(
                color: Colors.blue,
                child: const Text("This text has responsive padding"),
              ),
            ),
            ResponsiveMargin(
              smallScreenMargin: 8.0,
              largeScreenMargin: 16.0,
              child: ElevatedButton(
                onPressed: () {
                  // Button action
                },
                child: const Text("Button with responsive margin"),
              ),
            ),
            ElevatedButton(
              onPressed: () {
                // Button action
              },
              child: const Text("Button without responsive margin"),
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
160
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

A simple Flutter package to add responsive padding and margin widgets for consistent, adaptive spacing across different screen sizes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on responsive_spacing_v2