v4.2.0
firebase_pagination
실시간 데이터베이스와 Firestore를 페이지네이션하고 실시간 업데이트를 지원하는 플러터 패키지입니다.
92좋아요 1.1천30일 다운로드160Pub 점수
AndroidiOSWebmacOSWindows
실시간 데이터베이스와 Firestore를 페이지 단위로 처리하고 실시간 업데이트를 지원하는 플러터 패키지입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A simple and effective way to Paginate Firebase related data.
| Realtime Database | Firestore |
|---|---|
FirestorePagination to simplify paginating firestore collections.RealtimeDBPagination to simplify paginating realtime database nodes.isLive property.RealtimeDBPagination.firebase_pagination: ^4.2.0
import 'package:firebase_pagination/firebase_pagination.dart';
FirestorePagination(
query: FirebaseFirestore.instance.collection('scores').orderBy('score'),
itemBuilder: (context, docs, index) {
final data = docs[index].data() as Map<String, dynamic>;
// Do something cool with the data
},
),
RealtimeDBPagination(
query: FirebaseDatabase.instance.ref().child('scores').orderByChild('score'),
orderBy: 'score',
itemBuilder: (context, dataNodes, index) {
final data = dataNodes[index].value as Map<String, dynamic>;
// Do something cool with the data
},
),
isLive is true, a live listener is added to fetch data before the first load. (i.e. Newly added data will be automatically loaded)FirestorePagination and RealtimeDBPagination uses maximum of two stream listeners to fetch data.| Property | Description | Type | Default |
|---|---|---|---|
query |
The query to use to fetch data from Firestore / Realtime Database. | Query | - |
itemBuilder |
The builder to use to build the items in the list. | Function | - |
separatorBuilder |
The builder to use to render the separator. | Function | separatorBuilder (package fn) |
limit |
The number of items to fetch from Database at once. | int | 10 |
viewType |
The type of view to use for the list. | ViewType | ViewType.list |
isLive |
Whether to fetch newly added items as they are added to Database. | bool | false |
gridDelegate |
The delegate to use for the GridView. | SliverGridDelegate | crossAxisCount: 2 |
wrapOptions |
The Wrap widget properties to use. | WrapOptions | WrapOptions() |
pageOptions |
The PageView widget properties to use. | PageOptions | PageOptions() |
onEmpty |
The widget to use when data is empty. | Widget | EmptyScreen() |
bottomLoader |
The widget to use when more data is loading. | Widget | BottomLoader() |
initialLoader |
The widget to use when data is loading initially. | Widget | InitialLoader() |
scrollDirection |
The scrolling direction of the ScrollView. | Axis | false |
reverse |
Whether the ScrollView scrolls in the reading direction. | bool | false |
shrinkWrap |
Should the ScrollView be shrink-wrapped. | bool | false |
physics |
The scroll behavior to use for the ScrollView. | ScrollPhysics | - |
padding |
The padding to use for the ScrollView. | EdgeInsetsGeometry | - |
controller |
The controller to use for the ScrollView. | ScrollController | ScrollController() |
pageController |
The controller to use for the PageView. | PageController | PageController() |
descending |
Whether the data should be fetched in descending order or not. Only works for RealtimeDBPagination | bool | false |
의존성 목록 4 개
^6.0.0^12.0.0{"sdk":"flutter"}^6.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗