Search packages, repositories and app categories

extended_list cover
Package detailsv3.0.2

extended_list

extended list support track collect garbage/viewport indexes, build lastChild as special child and enable to layout close to trailing.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
4.7K
Likes
27
Pub points
150

Install package

flutter pub add extended_list

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

ExtendedList is a Flutter package that enhances standard list widgets with advanced features like tracking collection and garbage collection, viewport indexes, and customizable lastChild layout. It enables precise control over the trailing edge of lists, allowing developers to build layouts close to the trailing edge with improved performance and flexibility. Ideal for complex scrolling scenarios requiring fine-grained control over item rendering and positioning.

Use cases

  • Custom scroll behaviors
  • Performance-optimized long lists
  • Tail-aligned custom widgets
  • Complex list layouts
  • Dynamic content insertion
  • Viewport-aware UIs

Key features

  • Tracks viewport and garbage collection
  • Supports special lastChild configuration
  • Enables trailing-edge layout precision
  • Optimized for large datasets
  • Flexible item building
  • Real-time index tracking

Suitable for

  • Developers needing advanced list control
  • Apps with dynamic or infinite lists
  • High-performance scrolling interfaces
  • Customizable list UIs
  • Complex data visualization in lists

Considerations

  • Requires understanding of scroll mechanics
  • May increase complexity for simple lists
  • Needs careful handling of lastChild logic
  • Not ideal for basic list use cases
  • Potential memory overhead with heavy customization

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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),

Categories

Dependencies

Dependency list 1 items

  • extended_list_library^3.0.0

Source repository

Projects using this package