vertical_card_pager 1.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new75


Use dynamic and beautiful card view pagers to help you create great apps.

Preview #

Installing #

  1. Add dependency to pubspec.yaml

    Get the latest version in the 'Installing' tab on pub.dartlang.org

dependencies:
    vertical_card_pager: ^1.2.0
  1. Import the package
import 'package:vertical_card_pager/vertical_card_pager.dart';
  1. Adding VerticalCardPager

With optional parameters

  @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
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }

How to use #

Check out the example app in the example directory or the 'Example' tab on pub.dartlang.org for a more complete example.

Example #

Reference #

This package's animation is inspired from from this Dribbble art.

TODO #

  • [x] Make proto type
  • [x] Add or Remove Item effect
  • [x] Add round edge in each item view
  • [x] Handle touch event
  • [x] Deploy plug in

1.0.0 #

  • first release

1.0.1 #

  • remove unused assets

1.0.2 #

  • update readme

1.0.3 #

  • update readme

1.1.0 #

  • enable web

1.1.1 #

  • fix build error

1.1.2 #

  • disable web

1.1.3 #

  • Fix bug about below error message
The following assertion was thrown building Container(constraints: BoxConstraints(w=-1.1, h=53.4; NOT NORMALIZED), dirty):
BoxConstraints has a negative minimum width.

1.2.0 #

  • Add optinail parameter initialPage. initialPage was default value 2

example/lib/main.dart

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

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

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

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @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(
                  textStyle: TextStyle(
                      color: Colors.white, fontWeight: FontWeight.bold),
                  titles: titles,
                  images: images,
                  onPageChanged: (page) {
                    // print(page);
                  },
                  onSelectedItem: (index) {},
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  vertical_card_pager: ^1.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:vertical_card_pager/vertical_card_pager.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
49
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
75
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:vertical_card_pager/vertical_card_pager.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:vertical_card_pager/vertical_card_pager.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:vertical_card_pager/vertical_card_pager.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:vertical_card_pager/vertical_card_pager.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • vertical_card_pager that is a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test