expand 1.1.0 copy "expand: ^1.1.0" to clipboard
expand: ^1.1.0 copied to clipboard

A package designed to help you easily create sleek and fast expandable widgets.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(title: const Text('Expandable Widgets Example')),
        body: ExpandableProvider(
          child: ListView(
            children: [
              ExpandableTile(
                title: const Text('Tile 1'),
                detailsBuilder: (context) =>
                    Container(height: 200, color: Colors.red),
              ),
              ExpandableTile(
                title: const Text('Tile 2'),
                detailsBuilder: (context) =>
                    Container(height: 200, color: Colors.green),
              ),
              ExpandableTile(
                id: 'tile3',
                title: const Text('Tile 3'),
                trailing: const Icon(Icons.arrow_drop_down),
                detailsBuilder: (context) =>
                    Container(height: 200, color: Colors.blue),
              ),
              ExpandableCard(
                childBuilder: (context, _) => AspectRatio(
                  aspectRatio: 2,
                  child: Ink.image(
                    image: const NetworkImage('https://picsum.photos/400/200'),
                    fit: BoxFit.cover,
                  ),
                ),
                detailsBuilder: (context) => Column(
                  children: [
                    Container(height: 200, color: Colors.pink),
                    Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: FilledButton(
                        onPressed: () {
                          ExpandableProvider.of(context).open('tile3');
                        },
                        child: const Text('Open tile 3'),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
0
pub points
47%
popularity

Publisher

unverified uploader

A package designed to help you easily create sleek and fast expandable widgets.

Repository (GitHub)
View/report issues

Topics

#expandable #widget #material

Funding

Consider supporting this project:

github.com
buymeacoffee.com

License

unknown (license)

Dependencies

flutter

More

Packages that depend on expand