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

パッケージ詳細v1.0.7

loadmore_listview

読み込みと更新機能を備えた使いやすいListViewを提供

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
1520
いいね数
25
Pub ポイント
140

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

flutter pub add loadmore_listview

パッケージ概要

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

無限スクロールとプルトゥリフレッシュ機能を備えたListViewの実装を簡素化するFlutterパッケージです。ユーザーがスクロールする際に追加のアイテムを読み込むためのクリーンで使いやすいインターフェースを提供し、ボイラープレートコードを削減します。Android、iOS、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームアプリに最適です。Dartで構築されており、既存のFlutterプロジェクトにスムーズに統合できます。

用途

  • 無限スクロールフィード
  • プルダウンでデータリストを更新する
  • EC商品リスト
  • ソーシャルメディアのタイムライン
  • ニュースフィードアプリケーション

主な機能

  • 組み込みのプルトゥリフレッシュ
  • スクロール時に自動で読み込み
  • カスタマイズ可能な読み込みインジケーター
  • null セーフティをサポート
  • クロスプラットフォーム互換性

適している対象

  • シンプルなページネーションを求める開発者
  • 動的なコンテンツを持つアプリ
  • スムーズなスクロールが必要なプロジェクト
  • Flutterを学ぶ初心者
  • 大規模なデータセットを持つアプリケーション

注意事項

  • ネットワークリクエストに対する適切なエラーハンドリングが必要です
  • 複雑な読み込み条件に対応するためのカスタムロジックが必要になる可能性があります
  • 静的リストには適していません
  • 高度なUIニーズに対するカスタマイズの選択肢が限られている
  • データソースの外部状態管理に依存しています

元の README

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

Load More Listview

An Widget with the Load more item and refresh

Base on ListView and CustomScrollListview

LoadMoreListView.builder

Getting Started

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

dependencies:
  ...
  loadmore_listview: ^1.0.7

Import it:

import 'package:loadmore_listview/loadmore_listview.dart';

Usage Examples

LoadMoreListView.builder
LoadMoreListView.builder(
    //is there more data to load
    haveMoreItem: true,
    //Trigger the bottom loadMore callback
    onLoadMore: () async{
      //wait for your api to fetch more items
      await Future.delayed(const Duration(seconds: 1));
    },
    //pull down refresh callback
    onRefresh: () async{
      //wait for your api to update the list
      await Future.delayed(const Duration(seconds: 1));
    },
    //you can set your loadMore Animation
    loadMoreWidget: Container(
        margin: const EdgeInsets.all(20.0),
        alignment: Alignment.center,
        child: const CircularProgressIndicator(
          valueColor: AlwaysStoppedAnimation(Colors.blueAccent),
        ),
    ),
    //ListView
    itemCount: 20,
    itemBuilder: (context, index) {
        return Container(
            margin: const EdgeInsets.all(30),
            width: double.infinity,
            alignment: Alignment.center,
            child: Text('$index'),
        );
    },
);
LoadMoreListView.separated
LoadMoreListView.separated(
    //...
    separatorBuilder: (context, index) {
      return const Divider();
    },
);
LoadMoreListView.customScrollView
LoadMoreListView.customScrollView(
    //...
    slivers: [
        SliverList(
            delegate: SliverChildBuilderDelegate(
              (context, index) {
                return Container(
                  margin: const EdgeInsets.all(30),
                  width: double.infinity,
                  alignment: Alignment.center,
                  child: Text(list[index]),
                );
              },
              childCount: list.length,
            ),
        ),
    ],
);

カテゴリー

ソースリポジトリ

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

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