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

パッケージ詳細v2.0.1

flippable_box

両面のコンテナで、裏返すと両面のコンテンツが表示されます。

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

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

flutter pub add flippable_box

パッケージ概要

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

flippable_box は、2つの異なるコンテンツ面を切り替えることができる両面コンテナを提供する Flutter パッケージです。前面と背面の間で滑らかでアニメーション付きの遷移を可能にし、カードやフリップ効果などのインタラクティブな UI 要素に最適です。Android、iOS、Web、macOS、Windows、Linux などすべての主要プラットフォームをサポートしており、クロスプラットフォームアプリケーションに非常に柔軟に対応できます。Flutter のアニメーションシステムに基づいて構築されており、反応性がありカスタマイズ可能なフリップ動作を提供します。

用途

  • インタラクティブカードインターフェース
  • 製品詳細フリップカード
  • クイズまたはフラッシュカードアプリ
  • アニメーションナビゲーション要素
  • ゲームUIコンポーネント

主な機能

  • スムーズな3Dフリップアニメーション
  • カスタマイズ可能な前面および背面のコンテンツ
  • クロスプラットフォーム互換性
  • 既存のウィジェットとの簡単な統合
  • タップおよびジェスチャーのトリガーをサポート

適している対象

  • インタラクティブなUIを構築する開発者
  • 教育アプリ開発者
  • ゲーム化アプリケーションデザイナー
  • ダイナミックなトランジションを求めるデザイナー

注意事項

  • 低性能デバイスでのパフォーマンスに影響を与える可能性があります
  • 複雑なコンテンツには、慎重なレイアウト管理が必要です
  • コンテナベースの切り替えのみに限定
  • インタラクティブでない静的表示には適していません

元の README

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

flippable_box

FlippableBox is a double-sided Container, that holds two pieces of content and automatically re-sizes to match its content, whenever its flipped over.

Usage

First import the package into your class:

import 'package:flippable_box/flippable_box.dart';

Create a FlippableBox with two child Containers. Change the isFlipped property to trigger the internal flip animation.

GestureDetector(
    onTap: () => setState(() => _isFlipped = !_isFlipped),
    child: FlippableBox(
        front: Container(width: 200, height: 200, color: Colors.white),
        back: Container(width: 300, height: 300, color: Colors.white),
        isFlipped: _isFlipped,
    ),
)

NOTE: It is required that the children are Containers, and have their size or constraints set manually, as shown in the example above. This is so the Box knows what its target size is when animating.

To control the flip animation, you can set duration, curve and flipVt which will cause the flip to be in the vertical axis rather than horizontal.

You can also specify a bg which takes a BoxDecoration, and a borderRadius in case you'd like to clip the child contents.

FlippableBox(
    front: child1,
    back: child2,
    isFlipped: _isFlipped,
    borderRadius: 32, //Uses a ClipRRect to clip contents of child containers
    bg: BoxDecoration(color: Colors.white), //Paints the box itself with a shared background
    duration: 0.5, //half second duration
    flipVt: true, //Flip vertically instead of horizontal
    curve: Curves.easeOut,
)

Example

See the example directory for a simple example.

カテゴリー

ソースリポジトリ

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

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