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

swipable_stack のカバー
パッケージ詳細v2.0.0

swipable_stack

ユーザーがTinderのように水平および垂直にスワイプでき、美しいアニメーションを備えたカードのスタック用ウィジェットです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
8300
いいね数
325
Pub ポイント
150

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

flutter pub add swipable_stack

パッケージ概要

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

Tinderを参考にした、スムーズな水平および垂直スワイプアニメーションを持つインタラクティブなカードスタックを作成するFlutterウィジェットです。ユーザーは直感的なジェスチャーでカードを左または右(または上/下)にスワイプでき、エレガントな遷移を実現します。デートアプリ、プロダクトショーケース、コンテンツ発見機能など、スワイプベースのインターフェースが必要なアプリに最適です。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxを含む複数のプラットフォームをサポートしており、デバイス間での一貫性のある動作を保証しています。

用途

  • デートアプリのインターフェース
  • 製品またはアイテムの発見
  • スワイプジェスチャーによるコンテンツの閲覧
  • インタラクティブなオンボーディングフロー
  • ゲーム化されたユーザー参加
  • スワイプベースのクイズ

主な機能

  • スムーズな水平および垂直スワイプ
  • カスタマイズ可能なアニメーションカーブ
  • フィードバック付きのジェスチャー認識
  • 複数プラットフォームのサポート
  • 既存のUIとのスムーズな統合
  • カスタマイズ可能なカードの配置と余白

適している対象

  • スワイプベースのUIを構築する開発者
  • インタラクティブなカード体験を求めるデザイナー
  • ジェスチャー駆動型ナビゲーションを必要とするアプリ
  • クロスプラットフォームのモバイルおよびWebアプリケーション
  • インタラクティブなレイアウトのプロトタイピング

注意事項

  • 大規模なカードスタックに対してパフォーマンスチューニングが必要になる場合があります
  • 複雑なアニメーションのための組み込みカスタマイズが限られている
  • 素早いスワイプ時に状態を慎重に扱う必要があります
  • 非常に高い頻度のスワイプ操作に最適化されていません
  • 応答性を維持するために、中程度のカード数に最適です

元の README

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

swipable_stack

pub.dev github likes popularity pub points license

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations like Tinder UI.

demo

(Sorry, the package name swipable_stack is typo of swipeable stack)

Usage

builder

A SwipableStack uses a builder to display widgets.

SwipableStack(
  builder: (context, properties) {
    return Image.asset(imagePath);
  },
),

onSwipeCompleted

You can get completion event with onSwipeCompleted.

SwipableStack(
  onSwipeCompleted: (index, direction) {
    print('$index, $direction');
  },
)

overlayBuilder

You can show overlay on the front card with overlayBuilder.

SwipableStack(
  overlayBuilder: (context, properties) {
    final opacity = min(properties.swipeProgress, 1.0);
    final isRight = properties.direction == SwipeDirection.right;
    return Opacity(
      opacity: isRight ? opacity : 0,
      child: CardLabel.right(),
    );
  },
)

controller

SwipableStackController allows you to control swipe action & also rewind recent action.

final controller = SwipableStackController();

SwipableStack(
  controller:controller,
  builder: (context, properties) {
    return Image.asset(imagePath);
  },
);
controller.next(
  swipeDirection: SwipeDirection.right,
);
controller.rewind();

SwipableStackController provides to access currentIndex of SwipableStack.

final controller = SwipableStackController();
controller.addListener(() {
  print('${_controller.currentIndex}');
});

onWillMoveNext

You can also restrict user actions according to index or action with onWillMoveNext.

SwipableStack(
  onWillMoveNext: (index, direction) {
    final allowedActions = [
      SwipeDirection.right,
      SwipeDirection.left,
    ];
    return allowedActions.contains(direction);
  },
);

swipeAssistDuration

You can set the speed the user is able to swipe through Widgets with the swipeAssistDuration.

SwipableStack(
  swipeAssistDuration: Duration(milliseconds: 100),
)

The default is 650ms.

stackClipBehaviour

You can set the clipBehaviour of the stack with the stackClipBehaviour.
Change it to Clip.none to exceed the boundaries of parent widget size.

SwipableStack(
  stackClipBehaviour: Clip.none,
)

The default is Clip.hardEdge.

allowVerticalSwipe

Disable vertical swipe with allowVerticalSwipe.
Changing to false disable vertical swipe capabilities

SwipableStack(
  allowVerticalSwipe: false,
)

The default is true.

swipeTopAnchor

Set the swipe anchor with swipeAnchor with the following enum SwipeAnchor.top : card rotation on bottom and anchored on top SwipeAnchor.bottom : card rotation on top and anchored on bottom

SwipableStack(
  swipeAnchor: SwipeAnchor.top,
)

The default is SwipeAnchor.top.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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