Skip to content

clong1995/StorySwiper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Story Swiper

pub package

Screenshots

Installing

dependencies:
  storyswiper: ^1.0.1

Using

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'StorySwiper Example',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key}) : super(key: key);

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

class _MyHomePageState extends State<MyHomePage> {
  final List<Color> colors = [
    Colors.red,
    Colors.orange,
    Colors.yellow,
    Colors.green,
    Colors.blue,
    Colors.indigo,
    Colors.purple,
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("StorySwiper Example"),
      ),
      body: Container(
        height: 340,
        child: StorySwiper.builder(
          itemCount: colors.length,
          aspectRatio: 2 / 3,
          depthFactor: 0.2,
          dx: 60,
          dy: 20,
          paddingStart: 32,
          verticalPadding: 32,
          visiblePageCount: 3,
          widgetBuilder: (index) {
            return Container(
              decoration: BoxDecoration(
                color: colors[index],
                borderRadius: BorderRadius.all(
                  Radius.circular(16),
                ),
              ),
            );
          },
        ),
      ),
    );
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 71.9%
  • HTML 15.3%
  • Kotlin 6.3%
  • Swift 5.9%
  • Objective-C 0.6%