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

expandable_widgets のカバー
パッケージ詳細v1.0.3+1

expandable_widgets

パッケージは、100%のDartで書かれたFlutter用の拡張可能なウィジェットを提供します。

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

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

flutter pub add expandable_widgets

パッケージ概要

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

expandable_widgets パッケージは、Flutter用のカスタマイズ可能な100%Dartベースの拡張可能ウィジェットを提供します。開発者は滑らかなアニメーション付きで折りたたみ可能なコンテンツセクションを作成でき、カードや拡張タイルで情報を整理するのに最適です。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、デバイス間で一貫した動作を保証します。pub addによる簡単な統合により、動的なコンテンツ表示制御が可能になり、ユーザー体験が向上します。

用途

  • 折りたたみ可能なFAQセクションの作成
  • インタラクティブな製品詳細カードの作成
  • 拡張可能なナビゲーションメニューの設計
  • アニメーション付きアコーディオンの実装
  • コンパクトなレイアウトで詳細情報を表示する

主な機能

  • スムーズなアニメーションの遷移
  • 完全にカスタマイズ可能な外観
  • すべての主要な Flutter プラットフォームをサポートしています
  • 軽量で純粋なDart実装
  • 既存のUIとのスムーズな統合

適している対象

  • レスポンシブなカードベースのインターフェースを開発する開発者
  • インタラクティブなコンテンツ切り替えを必要とするアプリ
  • 軽量拡張コンポーネントを必要とするプロジェクト

注意事項

  • 複雑なレイアウトには追加のスタイル設定が必要になる場合があります
  • 制限された組み込みテーマオプション
  • 非常に大きなデータセットには最適化されていません

元の README

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

Expandable Widgets

A package provides expandable widgets for Flutter, written in 100% Dart.

Why?

Fast

There are various ways of getting expandable behaviour in Flutter. This package provides boilerplate code and reduces production time.

Inclusive

Expandable Widgets offers a variety of uses. Check More Usecases

Easy

You can obtain the basic expandable widgets by writing one single line of code.

Examples

General Use:

You can use Expandable with two required parameters.

Expandable(
  firstChild: const Text('Hello world!'),
  secondChild: Center(child: const Text('Hello world!')),
),

Extended Example:

If you add subChild argument you will get an expandable with subtitle. See 1.0.2 or older versions for previous extended expandables.

Expandable(
  firstChild: Padding(
    padding: const EdgeInsets.all(8.0),
    child: Text(data, maxLines: 3, textAlign: TextAlign.justify),
  ),
  secondChild: Padding(
    padding: const EdgeInsets.all(8.0),
    child: Text(data, maxLines: 3, textAlign: TextAlign.justify),
  ),
  subChild: Text("Show Details"),
),

Expandable Text:

You can use ExpandableText by giving the required parameter, textWidget. ExpandableText will handle the rest.

ExpandableText(textWidget: Text(data, maxLines: 3),

More Usecases

Expandable

Let's say you want to use Expandable and Flutter's AnimatedIcon at the same time.

Just add the relevant animationController. Expandable will handle the rest!

Row(
  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  children: [
    Expandable(
      firstChild: Padding(
        padding: const EdgeInsets.only(right: 8.0),
        child: Text('Settings', style: TextStyle(fontSize: 18)),
      ),
      secondChild: Column(children: [Text('Option 1'), Text('Option 2'), Text('Option 3')]),
      animationController: _animationController,
      arrowLocation: ArrowLocation.left,
      arrowWidget: Padding(
        padding: const EdgeInsets.all(8.0),
        child: AnimatedIcon(icon: AnimatedIcons.menu_close, progress: _animation, size: 16),
      ),
    ),

Even more, one can combine AnimatedIcon and Expandable's rotation animation.

Give the same animation to AnimatedIcon and Expandable and finally, do not forget to add relevant animationController to Expandable.

    Expandable(
      firstChild: Padding(
        padding: const EdgeInsets.only(right: 8.0),
        child: Text('Settings', style: TextStyle(fontSize: 18)),
      ),
      secondChild: Column(children: [Text('Option 1'), Text('Option 2'), Text('Option 3')]),
      animation: _animation,
      animationController: _animationController,
      arrowLocation: ArrowLocation.left,
      arrowWidget: Padding(
        padding: const EdgeInsets.all(8.0),
        child: AnimatedIcon(icon: AnimatedIcons.menu_close, progress: _animation, size: 16),
      ),
    ),
  ],
),

Nested Expandable Widgets

Expandable(
  firstChild: Text('Nested Expandable Widgets'),
  secondChild: Expandable(
    borderRadius: BorderRadius.zero,
    boxShadow: [],
    firstChild: Text('Second Expandable'),
    secondChild: Expandable(
      borderRadius: BorderRadius.zero,
      boxShadow: [],
      firstChild: Text('Third Expandable'),
      secondChild: Center(child: Text('The End')),
    ),
  ),
),

ExpandableText

You can change the location of the arrow

ExpandableText(
  textWidget: Text(data).copyWith(maxLines: 3),
  arrowLocation: ArrowLocation.bottom,
  finalArrowLocation: ArrowLocation.bottom,
),

You can use helper text

ExpandableText(textWidget: Text(data, maxLines: 3), helper: Helper.text),

Customized ExpandableText with helper text

ExpandableText(
  textWidget: Text(data, maxLines: 5, textAlign: TextAlign.justify),
  backgroundColor: Colors.white,
  helper: Helper.text,
  helperTextList: const ['...More', '...Less'],
  helperTextStyle: const TextStyle(color: Colors.orange, fontWeight: FontWeight.bold),
  boxShadow: const [BoxShadow(color: Colors.orange, offset: Offset(2, 2), blurRadius: 4)],
  borderRadius: BorderRadius.circular(20.0),
  padding: const EdgeInsets.all(12.0),
  onPressed: () => print('hi!'),
),

Or you can remove the helper

ExpandableText(textWidget: Text(data, maxLines: 3), helper: Helper.none),

Known issues

For more info please see example.

カテゴリー

ソースリポジトリ

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

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