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

パッケージ詳細v1.2.0

flex_list

柔軟なリスト用のFlutterレイアウトウィジェットです。wrap内でのExpandウィジェットの動作と同様に振る舞います。

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

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

flutter pub add flex_list

パッケージ概要

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

FlexList は、レイアウト制約内で動的に適応する柔軟で応答性のあるリストを作成するために設計された Flutter ウィジェットです。Wrap 内の Expand ウィジェットと同様に動作し、利用可能なスペースに基づいてアイテムが拡大・縮小できます。さまざまな画面サイズや向きに対応した流動的でスケーラブルなリストレイアウトを作成するのに最適であり、複雑なカスタムコーディングなしに UI の柔軟性を向上させます。このパッケージはすべての主要プラットフォームをサポートしており、アダプティブなリスト動作が必要なクロスプラットフォームアプリケーションに適しています。

用途

  • 応答性のあるリストレイアウト
  • 動的アイテムサイズ
  • クロスプラットフォームUIデザイン
  • 適応型コンテンツコンテナ
  • 柔軟なグリッド風リスト
  • ネストされたレイアウトの統合

主な機能

  • 自動リサイズリストアイテム
  • すべての Flutter プラットフォームをサポートしています
  • 直感的なラッピングのような挙動
  • 必要な最小構成
  • 既存のレイアウトとのシームレスな統合
  • デバイス間での一貫した動作

適している対象

  • 応答性のあるUIを構築する開発者
  • 適応型リストデザインを必要とするアプリ
  • クロスプラットフォームプロジェクト
  • レイアウト重視のアプリケーション
  • 動的な余白を必要とするUIコンポーネント

注意事項

  • 複雑なネスト構造では、注意深く整合する必要がある場合があります
  • 非常に大きなデータセットでのパフォーマンスへの影響
  • 基本的なフレックス動作以外のカスタマイズは限定的
  • 固定サイズまたは剛性のあるレイアウトには適していない
  • 中程度のリストサイズに最適
  • 親コンテナの制約に依存する

元の README

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

Flex List

Pub Points Pub Points Pub Points

Provides a flexible list layout that behaves as you would expect from Expand widgets within a Wrap.

Features

FlexList puts as many provided elements as possible in one row (like Wrap), but also extends the width of the elements by the remaining space per row. This means that each row is filled to the maximum width.

Getting started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  flex_list: <latest_version>

In your library add the following import:

import 'package:flex_list/flex_list.dart';

Usage

The following example shows how to use FlexList. Beside the children property, you can set horizontalSpacing and verticalSpacing to define the spacing between the elements.

Note: Both spacing values are 10 by default.

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'FlexList Demo',
        theme: ThemeData(),
        home: Scaffold(
          body: Center(
            child: SizedBox(
                width: 300,
                child: FlexList(
                  horizontalSpacing: 5,
                  verticalSpacing: 10,
                  children: [
                    for (var i = 0; i < 10; i++)
                      Container(
                        color: Theme
                            .of(context)
                            .colorScheme.surfaceContainer,
                        padding: EdgeInsets.symmetric(
                            horizontal: 20 + 20 * (i % 4), vertical: 10),
                        child: Text("Item $i"),
                      )
                  ],
                )),
          ),
        ));
  }
}
Rendering of above Example
Example Rendering

Additional information

This package was written because of the lack of such layout function. The package repository is maintained on Github and published on pub.dev

カテゴリー

ソースリポジトリ

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