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

outdated

Carousel in flutter. Supports infinite looping and gives control over anchor and velocity.

example/lib/main.dart

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

import 'screens/complex.dart';
import 'screens/horizontal.dart';
import 'screens/vertical.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Infinite Carousel Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Infinite Carousel Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  InfiniteScrollController controller;
  int selectedIndex = 0;

  @override
  void initState() {
    super.initState();
    controller = InfiniteScrollController();
  }

  @override
  void dispose() {
    super.dispose();
    controller?.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(widget.title)),
      body: Column(
        children: [
          RaisedButton(
            child: Text('Horizontal example'),
            onPressed: () {
              Navigator.of(context).push(MaterialPageRoute(builder: (context) => Horizontal()));
            },
          ),
          RaisedButton(
            child: Text('Vertical example'),
            onPressed: () {
              Navigator.of(context).push(MaterialPageRoute(builder: (context) => Vertical()));
            },
          ),
          RaisedButton(
            child: Text('Complex example'),
            onPressed: () {
              Navigator.of(context).push(MaterialPageRoute(builder: (context) => Complex()));
            },
          ),
        ],
      ),
    );
  }
}
254
likes
40
pub points
97%
popularity

Publisher

verified publishergeekyants.com

Carousel in flutter. Supports infinite looping and gives control over anchor and velocity.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

flutter

More

Packages that depend on infinite_carousel