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

floating_pullup_card のカバー
パッケージ詳細v1.2.0

floating_pullup_card

Flutter用の美しいカスタムフローティングプルアップスタイルカード

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
58
いいね数
69
Pub ポイント
140

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

flutter pub add floating_pullup_card

パッケージ概要

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

Flutter向けに視覚的に魅力的でカスタマイズ可能な浮き上がるプルアップカードウィジェット。下部パネルのインタラクションを強化することを目的としています。画面下部から引き上げられ、浮遊するドラッグ可能なカードの動作を再現し、スムーズなアニメーションと応答性のあるジェスチャーを提供します。モーダルや詳細ビュー、インタラクティブなオーバーレイに最適です。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、デバイス間での一貫した挙動を実現しています。

用途

  • インタラクティブな下部パネル
  • モーダル詳細ビュー
  • ドラッグ可能なコンテンツオーバーレイ
  • ユーザー・プロファイル拡張子
  • フォームウィザード

主な機能

  • スムーズなドラッグアンドプルアニメーション
  • カスタマイズ可能な高さと外観
  • クロスプラットフォーム互換性
  • ジェスチャー対応デザイン
  • 設定可能なスナップポイント
  • 既存のUIとの簡単な統合

適している対象

  • インタラクティブなボトムシートを開発する開発者
  • 洗練されたUIコンポーネントを探しているデザイナー
  • 展開可能なコンテンツカードを必要とするアプリ
  • 豊富なユーザーインタラクションを備えたモバイルファーストアプリケーション
  • タッチ対応パネルを必要とするウェブおよびデスクトップアプリケーション

注意事項

  • 複雑なレイアウトには追加のスタイル設定が必要になる場合があります
  • 大量コンテンツを持つ低価格端末におけるパフォーマンスへの影響
  • 動的コンテンツに対する組み込み検証が限られている
  • フルスクリーンの遷移には適していない
  • ネストされたスクロールビューの取り扱いに注意が必要です

元の README

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

floating_pullup_card

A beautiful and custom floating pull up style Card for flutter

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  floating_pullup_card: <latest version>

Usage

Basic

You can get started really simple, just add

Basic Collapsed Basic Uncollapsed

FloatingPullUpCardLayout(
    child: Container(
        decoration: BoxDecoration(color: Colors.purple[100]),
        child: Placeholder(),
    ),
    body: Column(
        children: <Widget>[
            PlaceholderLines(
                count: 10,
                align: TextAlign.center,
            ),
        ],
    ),
),

where body is a Widget that is nested inside the card and child is the main layout content

Advanced

You can highly customize by defining custom builders, or properties as width , height, color, etc

Advanced Collapsed Advanced Uncollapsed

FloatingPullUpCardLayout(
        dismissable: _dismissable,
        state: _floatingCardState,
        dragHandleBuilder: _customDragHandle ? _customDragHandleBuilder : null,
        cardBuilder: _customCard ? _customCardBuilder : null,
        collpsedStateOffset:
            _customCollapsedOffset ? (maxHeight, _) => maxHeight * .75 : null,
        autoPadding: _autoPadd,
        body: Container(
          // padding: EdgeInsets.all(16),
          child: SingleChildScrollView(
            child: Column(
              children: <Widget>[
                PlaceholderLines(
                  count: 4,
                  align: TextAlign.center,
                ),
                /// ... more content
              ],
            ),
          ),
        ),
        child: Container(
          decoration: BoxDecoration(color: Colors.grey[300]),
          height: double.infinity,
          width: double.infinity,
          child: SingleChildScrollView(
            child: // ... Some content
            ),
          ),
        ),

For more info, please check the demo provided :)

Full API

/// The [Widget] to be used as the content of the main layout, not the card content
  final Widget child;

  /// The [Widget] to be used as the content of the floating card
  final Widget body;

  /// Set a custom [height] for the floating card,
  /// defaults to `86%` of total height of parent container or screen height if no finite height can be assumed
  final double height;

  /// Set a custom [width] for the floating card,
  /// defaults to `100%` of total width of parent container or screen width if no finite width can be assumed
  final double width;

  /// Set a [cardElevation] for the material,
  /// defaults to `4`
  final double cardElevation;

  /// If true , the card can be dragged until it's hidden from screen
  /// defaults to [false]
  final bool dismissable;

  /// Sets the [state] of the floating card,
  /// See enum [FloatingPullUpState] for more details
  /// Defaults to [FloatingPullUpState.collapsed]
  final FloatingPullUpState state;

  /// Set a custom card [color] to the card background
  /// defaults to [Colors.white]
  ///
  /// This doesnt take any effect if using [cardBuilder] is defined
  final Color cardColor;

  /// Called each time the [FloatingPullUpState] is changed
  final ValueChanged<FloatingPullUpState> onStateChange;

  /// Defines a custom [dragHandleBuilder]
  final DragHandleBuilder dragHandleBuilder;

  /// Defines a custom [cardBuilder]
  final FloatingCardBuilder cardBuilder;

  /// Set a custom [borderRadius] of the default Card material
  ///
  /// This doesnt take any effect if using [cardBuilder] is defined
  final BorderRadius borderRadius;

  /// if true , this automatically adds padding to the [child] container,
  /// avoiding the card to float on top of [child] content
  /// defaults to [true]
  final autoPadding;

  /// Sets a custom function that return a custom `Y Offset`  for state [FloatingPullUpState.collapsed]
  /// Please take into account that offset start from top to bottom
  StateOffsetFunction collpsedStateOffset;

  /// Sets a custom function that return a custom `Y Offset`  for state [FloatingPullUpState.hidden]
  /// Please take into account that offset start from top to bottom
  StateOffsetFunction hiddenStateOffset;

  /// Sets a custom function that return a custom `Y Offset`  for state [FloatingPullUpState.uncollapsed]
  /// Please take into account that offset start from top to bottom
  StateOffsetFunction uncollpsedStateOffset;

  /// Defines a callback to be called when a user taps outside the card
  /// If function returns [FloatingPullUpState] it will change state to the returned one
  /// Take into account that this is not getting called if a widget inside body is already handling a `Gesture`
  final FloatingPullUpState Function() onOutsideTap;

  /// If true, this will show an overlay behind the card tht obscures content behind
  /// Defaults to[false]
  final bool withOverlay;

  /// Defines the `color` of the overlay , this only takes effect of [withOverlayOption] is true
  final Color overlayColor;

More Screenshots

Advanced Advanced GIF

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

カテゴリー

ソースリポジトリ

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

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