パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.3

infinite_cards

Flutter用の無限カードスイッチングUI、カスタムアニメーションをサポート

30日間ダウンロード
19
いいね数
31
Pub ポイント
40

パッケージをインストール

flutter pub add infinite_cards

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterパッケージで、スムーズかつカスタマイズ可能なカード遷移を可能にする無限カードスイッチングインターフェースを提供します。カスタムアニメーションをサポートしており、カバーフローまたは無限のカードスワイプ体験に似た魅力的でインタラクティブなUIを作成できます。画像、プロフィール、製品リストなどのコンテンツを視覚的にダイナミックに表示するのに最適です。このパッケージはシンプルさと柔軟性を重視し、pub.dev経由での簡単な統合が可能です。特に没入型のカードベースのナビゲーションが必要なアプリに特に役立ちます。

用途

  • インタラクティブ製品カルーセル
  • プロフィール閲覧インターフェース
  • スワイプジェスチャー付きの画像ギャラリー
  • 動的コンテンツスライダー
  • ユーザーのオンボーディングフロー

主な機能

  • 無限カードループ
  • カスタマイズ可能な遷移アニメーション
  • Flutter とのシンプルな統合
  • 水平カードスワイプのサポート
  • 拡張可能なアニメーション制御

適している対象

  • カードベースのUIを構築している開発者
  • 魅力的なコンテンツナビゲーションを必要とするアプリ
  • インタラクティブなプロトタイプを探しているデザイナー
  • 動的データ表示を備えたプロジェクト
  • ビジュアルストーリーテリングを備えたモバイルアプリ

注意事項

  • 大規模なデータセットに対してパフォーマンス最適化が必要になる可能性があります
  • カスタムアニメーションは、ジャンクを避けるために注意深く扱う必要があります
  • 限定されたプラットフォーム固有のカスタマイズオプション
  • 垂直スクロールに最適化されていません
  • 更新に外部のGitHubリポジトリに依存しています

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

InfiniteCards

License pub package

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

Android version

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

Flutter for Web version

https://github.com/BakerJQ/Flutter-InfiniteCards/tree/web

Screenshot

Android iOS

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,
    );
  }
  • animType : animation type
    • TO_FRONT : move the selected card to first
    • SWITCH : move the selected card to first, and the first card to the selected position
    • TO_END : move the first card to last position
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
            ...
          )

One example of implement Transform

Transform _defaultCommonTransform(Widget item, 
    double fraction, double curveFraction, double cardHeight, double cardWidth, int fromPosition, int toPosition) 
  {
  //Count of card which needs to move over
  int positionCount = fromPosition - toPosition;
  //0.8 scale for the first card, and -0.1 per card behind
  //(0.8 - 0.1 * fromPosition) = current specific card scale
  //(0.1 * fraction * positionCount) = scale while moving
  double scale = (0.8 - 0.1 * fromPosition) + (0.1 * fraction * positionCount);
  //translate -0.02 * cardHeight per card behind
  //-cardHeight * (0.8 - scale) * 0.5 to center the card
  double translationY = -cardHeight * (0.8 - scale) * 0.5 -
      cardHeight * (0.02 * fromPosition - 0.02 * fraction * positionCount);
  //return the Widget after scale and translate
  return Transform.translate(
    offset: Offset(0, translationY),
    child: Transform.scale(
      scale: scale,
      child: item,
    ),
  );
}

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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。