simple_coverflow 0.0.8 copy "simple_coverflow: ^0.0.8" to clipboard
simple_coverflow: ^0.0.8 copied to clipboard

An extremely simplistic "cover flow" style animation to swipe between widgets.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  static List<Container> data = [
    new Container(color: Colors.orange),
    new Container(color: Colors.blue),
    new Container(color: Colors.amber),
    new Container(color: Colors.deepPurple),
    new Container(color: Colors.green),
    new Container(color: Colors.red),
    new Container(color: Colors.yellow),
    new Container(color: Colors.greenAccent),
    new Container(color: Colors.black)
  ];

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Coverflow Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new Scaffold(
          appBar: new AppBar(
            title: new Text('Coverflow Demo'),
          ),
          body: new CoverFlow(itemBuilder: widgetBuilder,
              dismissedCallback: disposeDismissed,
              currentItemChangedCallback: (int index) {print(index);})
      ),
    );
  }

  Widget widgetBuilder(BuildContext context, int index) {
    if (data.length == 0) {
      return new Container();
    } else {
      return data[index % data.length];
    }
  }

  disposeDismissed(int item, DismissDirection direction) {
    data.removeAt(item % data.length);
  }
}
28
likes
40
pub points
22%
popularity

Publisher

unverified uploader

An extremely simplistic "cover flow" style animation to swipe between widgets.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on simple_coverflow