auto_spacer 0.0.4 copy "auto_spacer: ^0.0.4" to clipboard
auto_spacer: ^0.0.4 copied to clipboard

A simple package that inserts a spacer widget between two widgets. This package is useful when you want to insert a spacer widget between two widgets in a list.

auto_spacer #

pub package style: very good analysis Codecov

A simple Flutter package to insert a spacer between a list of widgets

Usage #

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'AutoSpacer Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: const ExampleScreen(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    const widgets = <Widget>[
      Text('Hello World'),
      ListTile(
        leading: Icon(Icons.ac_unit),
        title: Text('ListTile'),
        subtitle: Text('This is a ListTile'),
        trailing: Icon(Icons.arrow_forward_ios),
      ),
      TextField(
        decoration: InputDecoration(
          border: OutlineInputBorder(),
          labelText: 'TextField',
        ),
      ),
      ListTile(
        leading: Icon(Icons.ac_unit),
        title: Text('ListTile'),
        subtitle: Text('This is a ListTile'),
        trailing: Icon(Icons.arrow_forward_ios),
      ),
    ];
    return Scaffold(
      appBar: AppBar(
        title: const Text('AutoSpacer Example'),
      ),
      body: Center(
        child: ListView(
          shrinkWrap: true,
          children: AutoSpacer.fromList(widgets),
        ),
      ),
    );
  }
}
1
likes
160
points
32
downloads

Publisher

verified publishercrazycoder.in

Weekly Downloads

A simple package that inserts a spacer widget between two widgets. This package is useful when you want to insert a spacer widget between two widgets in a list.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on auto_spacer