flutter_infinite_scroll_pagination 1.0.0 copy "flutter_infinite_scroll_pagination: ^1.0.0" to clipboard
flutter_infinite_scroll_pagination: ^1.0.0 copied to clipboard

This Flutter package offers effortless infinite scroll loading with just one line of wrapping—no complex setup or controller needed for easy integration.

example/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_infinite_scroll_pagination/flutter_infinite_scroll_pagination.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(body: SafeArea(child: TestView())),
    );
  }
}

class TestView extends StatefulWidget {
  const TestView({super.key});

  @override
  State<TestView> createState() => _TestViewState();
}

class _TestViewState extends State<TestView> {
  final List<String> _items = [];

  @override
  Widget build(BuildContext context) {
    return InfiniteScrollPagination(
      isEnabled: _items.length < 100,
      onLoadMore: () async {
        await Future.delayed(Duration(seconds: 1));

        setState(() {
          for (int i = 0; i < 30; i++) {
            _items.add("Hello, World! ${_items.length}");
          }
        });
      },
      child: ListView.builder(
        shrinkWrap: true,
        itemCount: _items.length,
        itemBuilder: (context, index) {
          return Text(_items[index]);
        },
      ),
    );
  }
}
1
likes
160
points
29
downloads

Publisher

verified publisherttangkong.dev

Weekly Downloads

This Flutter package offers effortless infinite scroll loading with just one line of wrapping—no complex setup or controller needed for easy integration.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_appbar

More

Packages that depend on flutter_infinite_scroll_pagination