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

outdated

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(widgetBuilder,
              dismissedCallback: disposeDismissed)
      ),
    );
  }

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

  disposeDismissed(Widget item, DismissDirection direction) {
    data.remove(item);
  }
}
28
likes
0
pub points
22%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on simple_coverflow