垂直卡片翻页器

使用动态且精美的卡片视图分页器,帮助您创建出色的应用。

预览

84666831-8b787200-af5c-11ea-9bce-653c00d556fe

84666824-89161800-af5c-11ea-898c-34b65e03f6c5

84666830-8adfdb80-af5c-11ea-8383-878301d92179

84659970-2b310280-af53-11ea-9ba0-67fbf9a67639

新功能

v1.3.0

  • 更改对齐方式
居中(默认)
left center right

v1.4.0

  • 启用Web

安装

  1. 将依赖项添加到 pubspec.yaml

    在 pub.dartlang.org 的“安装”选项卡中获取最新版本

dependencies:
    vertical_card_pager: ^1.5.0
  1. 导入包
import 'package:vertical_card_pager/vertical_card_pager.dart';
  1. 添加VerticalCardPager

使用可选参数

  @override
  Widget build(BuildContext context) {
    final List<String> titles = ["RED", "YELLOW", "BLACK", "CYAN", "BLUE", "GREY", ];

    final List<Widget> images = [
      Container(
        color: Colors.red,
      ),
        Container(
        color: Colors.yellow,
      ),
        Container(
        color: Colors.black,
      ),
        Container(
        color: Colors.cyan,
      ),
        Container(
        color: Colors.blue,
      ),
        Container(
        color: Colors.grey,
      ),
    ];
    return Scaffold(
      body: SafeArea(
        child: Column(
          children: <Widget>[
            Expanded(
              child: Container(
                child: VerticalCardPager(
                  titles: titles,  // required
                  images: images,  // required
                  textStyle: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), // optional
                  onPageChanged: (page) { // optional
                  },
                  onSelectedItem: (index) { // optional
                  },
                  initialPage: 0, // optional
                  align : ALIGN.CENTER // optional
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

GitHub

https://github.com/Origogi/Vertical_Card_Pager