infinite_cards 1.0.3

  • Readme
  • Changelog
  • Installing
  • 78

InfiniteCards #

License

An infinite card switching UI for Flutter, support custom animation 可自定义动效的卡片切换视图(中文文档

Android version #

https://github.com/BakerJQ/Android-InfiniteCards

Screenshot #

AndroidiOS

Example #

cd ./example
flutter create .
flutter run

How to use #

Add dependencies #

dependencies:
  infinite_cards: ^1.0.3

Build controller in initState #

@override
  void initState() {
    super.initState();
    _controller = InfiniteCardsController(
      itemBuilder: _renderItem,
      itemCount: 5,
      animType: AnimType.SWITCH,
    );
  }

Build widget with controller #

InfiniteCards(
  controller: _controller,
)

Call methods from controller #

  _controller.previous();
  _controller.next();
  _controller.reset(...);

Animation transform and curve #

Default #

If you just use all default animations, just do nothing.

Customisation #

InfiniteCardsController(
            ...
            transformToFront: yourCustomTransformToFront,
            transformToBack: yourCustomTransformToBack,
            curve: yourCustomCurve
            ...
          )

License #

InfiniteCards is released under the Apache 2.0 license.

Copyright 2019 BakerJ.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at following link.

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

[1.0.1]

  • change controller params to private

[1.0.2]

  • change "interpolator" to "curve"

[1.0.3]

  • add example

Use this package as a library

1. Depend on it

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


dependencies:
  infinite_cards: ^1.0.3

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:infinite_cards/infinite_cards.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
56
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]
78
Learn more about scoring.

We analyzed this package on Oct 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.35 points)

44 out of 45 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/infinite_cards.dart.

Run flutter format to format lib/infinite_cards.dart.

Format lib/src/infinite_card_view.dart.

Run flutter format to format lib/src/infinite_card_view.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
cupertino_icons ^0.1.2 0.1.2
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test