listview_utils 0.2.7 copy "listview_utils: ^0.2.7" to clipboard
listview_utils: ^0.2.7 copied to clipboard

discontinued

Infinite scrolling list view with multiple data source mode support using adapters. Also supports header, footer widgets.

example/lib/main.dart

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

void main() {
  runApp(MaterialApp(
    title: 'Example',
    home: HomeScreen(),
  ));
}

class HomeScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('🔌 ListView_Utils')),
      body: SafeArea(
        child: CustomListView(
          paginationMode: PaginationMode.page,
          initialOffset: 0,
          loadingBuilder: CustomListLoading.defaultBuilder,
          header: Container(
            height: 50,
            child: Center(
              child: Text('😄 Header'),
            ),
          ),
          footer: Container(
            height: 50,
            child: Center(
              child: Text('🦶 Footer'),
            ),
          ),
          adapter: NetworkListAdapter(
            url: 'https://jsonplaceholder.typicode.com/posts',
            limitParam: '_limit',
            offsetParam: '_start',
          ),
          errorBuilder: (context, error, state) {
            return Column(
              children: <Widget>[
                Text(error.toString()),
                RaisedButton(
                  onPressed: () => state.loadMore(),
                  child: Text('Retry'),
                ),
              ],
            );
          },
          separatorBuilder: (context, _) {
            return Divider(height: 1);
          },
          empty: Center(
            child: Text('Empty'),
          ),
          itemBuilder: (context, _, item) {
            return ListTile(
              title: Text(item['title']),
              leading: Icon(Icons.assignment),
            );
          },
        ),
      ),
    );
  }
}
38
likes
40
pub points
60%
popularity

Publisher

verified publisherthemisir.com

Infinite scrolling list view with multiple data source mode support using adapters. Also supports header, footer widgets.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on listview_utils