card_selector 0.1.0 copy "card_selector: ^0.1.0" to clipboard
card_selector: ^0.1.0 copied to clipboard

Widget selector for Flutter using stack. The selector is fully configurable, animation time, gap between cards, size factor for stacxked cards, ...

Card Selector #

Widget selector for Flutter using stack. An example is available on this repo.

Getting Started #

Installation #

dependencies:
  flutter_card_selector: "^0.0.1"
copied to clipboard

Import the library #

import 'package:flutter_card_selector/flutter_card_selector.dart';
copied to clipboard

Add the widget #

const list = ["1", "2", "3", "4", "5"];
const colors = [Colors.blue, Colors.grey, Colors.red, Colors.cyan, Colors.amber];
class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    List<Widget> widgets = [];
    for (int i = 0; i < 5; i++) {
      widgets.add(Container(
        color: colors[i],
        child: Center(
            child: Text(
          list[i],
          style: Theme.of(context).textTheme.title,
        )),
      ));
    }
    return Padding(
      padding: EdgeInsets.only(top: 80.0),
      child: CardSelector(
        cards: widgets,
        mainCardWidth: 240,
        mainCardHeight: 150,
        mainCardPadding: -32,
        cardAnimationDurationMs: 200,
        cardsGap: 24.0,
        dropTargetWidth: 8.0,
      ),
    );
  }
}
copied to clipboard

Example #

39
likes
40
points
43
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.21 - 2025.04.05

Widget selector for Flutter using stack. The selector is fully configurable, animation time, gap between cards, size factor for stacxked cards, ...

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on card_selector