패키지, 저장소 및 앱 카테고리 검색

loadmore 표지
패키지 상세v2.1.0

loadmore

ListView를 아래로 스크롤하면 더 많은 데이터를 로드할 수 있습니다. 개발자가 페이지별로 데이터를 불러오는 것을 도와줍니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1만
좋아요
226
Pub 점수
150

패키지 설치

flutter pub add loadmore

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

loadmore 패키지는 ListView가 하단에 도달했을 때 데이터 로딩을 트리거하여 Flutter 앱에서 무한 스크롤을 구현하는 것을 간편하게 만듭니다. 개발자가 콘텐츠의 지연로딩을 효율적으로 관리할 수 있도록 도와주며, 메모리 사용량을 줄이고 대규모 데이터셋 렌더링 시 성능을 향상시킵니다. ListView 및 기타 스크롤 가능한 위젯과의 원활한 통합을 위해 설계되었으며, Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 이 패키지는 가볍고 사용이 쉬우며, 사용자가 스크롤할 때 부드럽고 필요에 따라 데이터를 가져올 수 있도록 최소한의 설정만으로도 활용 가능합니다.

사용 사례

  • 무한 스크롤 피드
  • 지연로딩 목록
  • 페이지inated 데이터 검색
  • 동적 콘텐츠 로딩
  • 전자상거래 제품 그리드

주요 기능

  • 자동 스크롤 감지
  • ListView와의 간편한 통합
  • 여러 플랫폼을 지원합니다
  • 최소한의 보일러플레이트 코드
  • 사용자 정의 가능한 로딩 표시기

적합한 대상

  • 스크롤 가능한 콘텐츠를 구축하는 개발자
  • 대규모 데이터셋을 가진 앱
  • 페이지네이션 중심의 UI
  • 크로스플랫폼 모바일 및 웹 앱
  • 효율적인 데이터 로딩 구현

고려 사항

  • 데이터 상태를 수동으로 처리해야 합니다
  • 고정 길이의 목록에는 적합하지 않습니다
  • 사용자 정의 오류 처리가 필요할 수 있습니다
  • 외부 데이터 소스에 의존합니다
  • 복잡한 스크롤 동작에 대한 사용자 정의 제한

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

loadmore

pub package GitHub

A loadMore library

Support ListView and SliverList

中文构思思路和使用说明可以看简书

screenshot

img

whole example

show https://github.com/CaiJingLong/flutter_listview_loadmore

install

in pubspec.yaml

dependencies:
  loadmore: ^2.0.1

import in dartfile:

import 'package:loadmore/loadmore.dart';

use in build:

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: Container(
        child: LoadMore(
          isFinish: count >= 60,
          onLoadMore: _loadMore,
          child: ListView.builder(
            itemBuilder: (BuildContext context, int index) {
              return Container(
                child: Text(list[index].toString()),
                height: 40.0,
                alignment: Alignment.center,
              );
            },
            itemCount: count,
          ),
        ),
      ),
    );
  }

  Future<bool> _loadMore() async {
    print("onLoadMore");
    await Future.delayed(Duration(seconds: 0, milliseconds: 100));
    load();
    return true;
  }

properties use:

child: Widget ,required , support ListView ListView.builder ListView.separated, other is not support.
onLoadMore:required A Function , `typedef Future<bool> FutureCallBack();` , reture true is success and status delay,return false or null ,then the status will change to fail.
isFinish: bool, optional, if true, then the status will change to finish ,default is false
delegate: LoadMoreDelegate,optional, see the LoadMoreDelegate class,default is DefaultLoadMoreDelegate
textBuilder: optional, the result will show in loading view ,if you use default delegate. default is DefaultLoadMoreText.chinese,
whenEmptyLoad: bool ,optional, default is true, when [whenEmptyLoad] is true, and when listView children length is 0,or the itemCount is 0,not build loadMoreWidget.
abstract class LoadMoreDelegate {
  const LoadMoreDelegate();

  double widgetHeight(LoadMoreStatus status) => _defaultLoadMoreHeight; // the loadMore height. default is 80.0

  Duration loadMoreDelay() => Duration(milliseconds: _loadMoreDelay);// When widget is created, the refresh delay time is triggered.

  Widget buildChild(LoadMoreStatus status); // build your widget in the loadmore widget.
}

other

homePage: https://github.com/CaiJingLong/flutter_listview_loadmore emailto me : cjl_spy@163.com

LICENSE

APACHE 2.0

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.