Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package to latest versions #166

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:paginate_firestore/paginate_firestore.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:cloud_firestore/cloud_firestore.dart' as firestore;
import 'package:firebase_core/firebase_core.dart';

Future<void> main() async {
Expand All @@ -10,7 +10,7 @@ Future<void> main() async {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
Expand All @@ -26,7 +26,7 @@ class MyApp extends StatelessWidget {
}

class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
const HomePage({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -36,7 +36,7 @@ class HomePage extends StatelessWidget {
centerTitle: true,
),
body: Scrollbar(
isAlwaysShown: true,
thumbVisibility: true,
child: PaginateFirestore(
// Use SliverAppBar in header to make it sticky
header: const SliverToBoxAdapter(child: Text('HEADER')),
Expand All @@ -55,7 +55,9 @@ class HomePage extends StatelessWidget {
);
},
// orderBy is compulsory to enable pagination
query: FirebaseFirestore.instance.collection('users').orderBy('name'),
query: firestore.FirebaseFirestore.instance
.collection('users')
.orderBy('name'),
itemsPerPage: 5,
// to fetch real-time data
isLive: true,
Expand Down
Loading