Skip to content

Commit 55fa64c

Browse files
committed
Fix tests, doc, example
1 parent 942002b commit 55fa64c

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

packages/firebase_ui_firestore/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FirebaseUIFirestoreExample extends StatelessWidget {
3535
body: FirestoreListView<User>(
3636
query: collection,
3737
padding: const EdgeInsets.all(8.0),
38-
itemBuilder: (context, snapshot) {
38+
itemBuilder: (context, snapshot, index) {
3939
final user = snapshot.data();
4040
return Column(
4141
children: [

packages/firebase_ui_firestore/lib/src/query_builder.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ typedef FirestoreEmptyBuilder = Widget Function(BuildContext context);
413413
/// ```dart
414414
/// FirestoreListView<Movie>(
415415
/// query: moviesCollection.orderBy('title'),
416-
/// itemBuilder: (context, snapshot) {
416+
/// itemBuilder: (context, snapshot, index) {
417417
/// Movie movie = snapshot.data();
418418
/// return Text(movie.title);
419419
/// },

tests/integration_test/firebase_ui_firestore/firestore_list_view_test.dart

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:cloud_firestore/cloud_firestore.dart';
6+
import 'package:firebase_ui_firestore/firebase_ui_firestore.dart';
67
import 'package:flutter/material.dart';
78
import 'package:flutter_test/flutter_test.dart';
8-
import 'package:firebase_ui_firestore/firebase_ui_firestore.dart';
99
import 'package:mockito/mockito.dart';
10+
1011
import '../utils.dart';
1112

1213
void main() {
@@ -61,7 +62,8 @@ void main() {
6162
body: FirestoreListView<Map>(
6263
query: collection.orderBy('value'),
6364
loadingBuilder: (context) => const Text('loading...'),
64-
itemBuilder: (context, snapshot) => throw UnimplementedError(),
65+
itemBuilder: (context, snapshot, index) =>
66+
throw UnimplementedError(),
6567
),
6668
),
6769
),
@@ -84,7 +86,8 @@ void main() {
8486
home: Scaffold(
8587
body: FirestoreListView<Map>(
8688
query: collection.orderBy('value'),
87-
itemBuilder: (context, snapshot) => throw UnimplementedError(),
89+
itemBuilder: (context, snapshot, index) =>
90+
throw UnimplementedError(),
8891
),
8992
),
9093
),
@@ -105,7 +108,8 @@ void main() {
105108
body: FirestoreListView<Map>(
106109
query: collection,
107110
cacheExtent: 0,
108-
itemBuilder: (context, snapshot) => throw UnimplementedError(),
111+
itemBuilder: (context, snapshot, index) =>
112+
throw UnimplementedError(),
109113
),
110114
),
111115
),
@@ -144,7 +148,7 @@ void main() {
144148
cacheExtent: 0,
145149
pageSize: 5,
146150
itemExtent: size,
147-
itemBuilder: (context, snapshot) {
151+
itemBuilder: (context, snapshot, index) {
148152
final v = snapshot.data()['value'] as int;
149153

150154
return Container(
@@ -208,6 +212,7 @@ class ListViewBuilderSpy<T> extends Mock {
208212
Widget call(
209213
BuildContext? context,
210214
T? snapshot,
215+
int? index,
211216
) {
212217
return super.noSuchMethod(
213218
Invocation.method(#call, [context, snapshot]),

0 commit comments

Comments
 (0)