lazy_loading_list 1.0.1 copy "lazy_loading_list: ^1.0.1" to clipboard
lazy_loading_list: ^1.0.1 copied to clipboard

Lazy loading Widget to load more items by the index of the item to increment you a list like infinite scroll.

example/lib/main.dart

// ignore_for_file: public_member_api_docs
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:lazy_loading_list/lazy_loading_list.dart';

void main() {
  runApp(MyApp(
    items: List<String>.generate(50, (i) => 'Item $i'),
  ));
}

class MyApp extends StatelessWidget {
  final List<String> items;

  MyApp({Key key, @required this.items}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final title = 'Long List';

    return MaterialApp(
      title: title,
      home: Scaffold(
        appBar: AppBar(
          title: Text(title),
        ),
        body: ListView.builder(
          itemCount: items.length,
          itemBuilder: (context, index) {
            return LazyLoadingList(
              initialSizeOfItems: 10,
              index: index,
              hasMore: true,
              loadMore: () => print('Loading More'),
              child: ListTile(
                title: Text('${items[index]}'),
              ),
            );
          },
        ),
      ),
    );
  }
}
39
likes
160
pub points
85%
popularity

Publisher

unverified uploader

Lazy loading Widget to load more items by the index of the item to increment you a list like infinite scroll.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on lazy_loading_list