flutter_infinite_scroll_pagination 1.0.0-beta1 copy "flutter_infinite_scroll_pagination: ^1.0.0-beta1" to clipboard
flutter_infinite_scroll_pagination: ^1.0.0-beta1 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: 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 Scaffold(
      backgroundColor: Colors.black,
      body: SafeArea(
        child: 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], style: TextStyle(color: Colors.white));
            },
          ),
        ),
      ),
    );
  }
}
1
likes
0
points
27
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)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_appbar

More

Packages that depend on flutter_infinite_scroll_pagination