slidable_cards 0.0.7 copy "slidable_cards: ^0.0.7" to clipboard
slidable_cards: ^0.0.7 copied to clipboard

outdated

A new Flutter package project.

example/lib/main.dart

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar'),
        ),
        body: SlidableCardList(
          duration: const Duration(milliseconds: 400),
          data: List.generate(
            6,
            (index) => '',
          ),
          itemsWidth: 360,
          foldedSpacing: 30,
          unfoldedSpacing: 16,
          builder: (current, index, _) => Container(
            height: 100,
            decoration: BoxDecoration(
              border: Border.all(
                color: Colors.white,
              ),
              color: _colorFromIndex(index),
            ),
          ),
        ),
      ),
    );
  }

  Color _colorFromIndex(int index) {
    if (index == 0) return Colors.red;
    if (index == 1) return Colors.orange;
    if (index == 2) return Colors.blue;
    if (index == 3) return Colors.green;
    if (index == 4) return Colors.yellow;
    return Colors.brown;
  }
}
1
likes
0
pub points
24%
popularity

Publisher

unverified uploader

A new Flutter package project.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on slidable_cards