auto_spacing 0.0.6 copy "auto_spacing: ^0.0.6" to clipboard
auto_spacing: ^0.0.6 copied to clipboard

Auto spacing is designed to automatically gives space between widgets.

example/lib/main.dart

import 'package:auto_spacing/auto_spacing.dart';
import 'package:flutter/material.dart';
void main() {
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const AutoSpacingExample(),
    );
  }
}

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



  @override
  State<AutoSpacingExample> createState() => _AutoSpacingExampleState();
}

class _AutoSpacingExampleState extends State<AutoSpacingExample> {
  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Auto Spacing Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('Hello',style: TextStyle(
              fontSize: 30
            ),),
            const Space(),
            const Text('World',style: TextStyle(
              fontSize: 30
            ),),
            const Space(25),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Container(
                  color: Colors.red,
                  height: 100,
                  width: 100,
                ),
                const Space(50),
                Container(
                  color: Colors.blue,
                  height: 100,
                  width: 100,
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
2
likes
150
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

Auto spacing is designed to automatically gives space between widgets.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on auto_spacing