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

extended_list のカバー
パッケージ詳細v3.0.2

extended_list

拡張リストは、ガベージ/ビューポートインデックスの収集を追跡し、lastChildを特別な子として構築し、末尾に近いレイアウトを可能にします。

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

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

flutter pub add extended_list

パッケージ概要

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

ExtendedList は、標準のリストウィジェットにコレクションの追跡やガベージコレクション、ビューポートインデックス、カスタマイズ可能な最後の子要素レイアウトといった高度な機能を追加するFlutterパッケージです。リストの末尾エッジに対する正確な制御を可能にし、開発者が末尾付近のレイアウトをより高いパフォーマンスと柔軟性で構築できるようにします。アイテムのレンダリングおよび配置に対して細かい制御が必要な複雑なスクロールシナリオに最適です。

用途

  • カスタムスクロール動作
  • パフォーマンス最適化された長いリスト
  • 尾揃えのカスタムウィジェット
  • 複雑なリストレイアウト
  • 動的コンテンツの挿入
  • ビューポート対応のUI

主な機能

  • ビューポートとガベージコレクションを追跡
  • 特別な lastChild 設定をサポートしています
  • トレーリングエッジレイアウトの精度を有効にする
  • 大規模データセット向けに最適化されています
  • 柔軟なアイテム構築
  • リアルタイムインデックス追跡

適している対象

  • 高度なリストコントロールが必要な開発者
  • 動的または無限リストを備えたアプリ
  • 高パフォーマンスなスクロールインターフェース
  • カスタマイズ可能なリストUI
  • リスト内の複雑なデータ可視化

注意事項

  • スクロールメカニズムの理解が必要です
  • シンプルなリストの複雑さを増す可能性があります
  • lastChild のロジックを慎重に扱う必要がある
  • 基本的なリストの使用ケースには適していません
  • 高度なカスタマイズによるメモリオーバーヘッドの可能性

元の README

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

extended_list

pub package GitHub stars GitHub forks GitHub license GitHub issues FlutterCandies QQ 群

Language: English | 中文简体

extended list(ListView/GridView) support track collect garbage of children/viewport indexes, build lastChild as special child in the case that it is loadmore/no more item and enable to layout close to trailing.

Web demo for ExtendedList

Use

  • add library to your pubspec.yaml

dependencies:
  extended_list: any

  • import library in dart file

  import 'package:extended_list/extended_list.dart';

CollectGarbage

track the indexes are collect, you can collect garbage at that monment(for example Image cache)

more detail

        ExtendedListView.builder(
            extendedListDelegate: ExtendedListDelegate(
                collectGarbage: (List<int> garbages) {
                print("collect garbage : $garbages");
                },),

ViewportBuilder

track the indexes go into the viewport, it's not include cache extent.

        ExtendedListView.builder(
            extendedListDelegate: ExtendedListDelegate(
                viewportBuilder: (int firstIndex, int lastIndex) {
                print("viewport : [$firstIndex,$lastIndex]");
                }),

LastChildLayoutTypeBuilder

build lastChild as special child in the case that it is loadmore/no more item.

img

img

        enum LastChildLayoutType {
        /// as default child
        none,

        /// follow max child trailing layout offset and layout with full cross axis extent
        /// last child as loadmore item/no more item in [ExtendedGridView] and [WaterfallFlow]
        /// with full cross axis extend
        fullCrossAxisExtent,

        /// as foot at trailing and layout with full cross axis extend
        /// show no more item at trailing when children are not full of viewport
        /// if children is full of viewport, it's the same as fullCrossAxisExtent
        foot,
        }

      ExtendedListView.builder(
        extendedListDelegate: ExtendedListDelegate(
            lastChildLayoutTypeBuilder: (index) => index == length
                ? LastChildLayoutType.foot
                : LastChildLayoutType.none,
            ),

CloseToTrailing

when reverse property of List is true, layout is as following. it likes chat list, and new session will insert to zero index. but it's not right when items are not full of viewport.

     trailing
-----------------
|               |
|               |
|     item2     |
|     item1     |
|     item0     |
-----------------
     leading

to solve it, you could set closeToTrailing to true, layout is as following. support [ExtendedGridView],[ExtendedList],[WaterfallFlow]. and it also works when reverse is flase, layout will close to trailing.

     trailing
-----------------
|     item2     |
|     item1     |
|     item0     |
|               |
|               |
-----------------
     leading
      ExtendedListView.builder(
        reverse: true,
        extendedListDelegate: ExtendedListDelegate(closeToTrailing: true),

カテゴリー

依存関係

依存関係一覧 1 件

  • extended_list_library^3.0.0

ソースリポジトリ

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