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

A universal, adaptive list view widget with automatic layout switching, skeleton loading, drag & drop, A-Z jump bar, selection modes, swipe actions, and responsive design.

advanced_list_view #

One widget. Every layout. All features.

A universal, adaptive, feature-packed replacement for ListView.builder and GridView.builder with automatic layout switching, skeleton loading, drag & drop, A-Z jump bar, selection modes, animations, and responsive design — all in one widget.

Phone Tablet Desktop
List 2-col Grid 3+ Grid

Features #

Adaptive Layout - Automatically switches between list and grid based on screen size
Skeleton Loading - Beautiful shimmer effects while data loads
🎯 Selection Modes - Single or multi-select with visual feedback
🔄 Drag & Drop - Reorder items with smooth animations
🔤 A-Z Index Bar - Quick navigation through large lists
📱 Responsive Design - Works seamlessly from phone to desktop
Animations - Smooth transitions for all interactions
👆 Swipe Actions - Leading and trailing swipe actions
🔄 Pull to Refresh - Built-in refresh indicator
📊 Sorting - Built-in sorting with custom comparators
🎨 Empty/Error States - Customizable empty and error widgets

Installation #

dependencies:
  advanced_list_view: ^1.0.0
flutter pub add advanced_list_view

Quick Start #

import 'package:advanced_list_view/advanced_list_view.dart';

AdvancedListView<Contact>(
  items: contacts,
  layoutMode: LayoutMode.auto,
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

Usage Examples #

Basic List #

AdvancedListView<String>(
  items: ['Item 1', 'Item 2', 'Item 3'],
  itemBuilder: (context, item, index, constraints) {
    return ListTile(title: Text(item));
  },
)

Adaptive Layout (Auto) #

AdvancedListView<Contact>(
  items: contacts,
  layoutMode: LayoutMode.auto,
  minItemWidth: 300,
  gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
    maxCrossAxisExtent: 400,
    childAspectRatio: 3,
  ),
  itemBuilder: (context, contact, index, constraints) {
    final isGrid = constraints.maxWidth > 600;
    return Card(
      child: Padding(
        padding: EdgeInsets.all(isGrid ? 16 : 12),
        child: Row(
          children: [
            CircleAvatar(
              radius: isGrid ? 30 : 24,
              backgroundImage: NetworkImage(contact.avatar),
            ),
            SizedBox(width: isGrid ? 16 : 12),
            Text(contact.name),
          ],
        ),
      ),
    );
  },
)

Skeleton Loading #

AdvancedListView<Contact>(
  items: contacts,
  isLoading: true,
  skeletonCount: 10,
  skeletonBuilder: (context) => SkeletonItem(height: 100),
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

Multi-Select #

AdvancedListView<Contact>(
  items: contacts,
  multiSelectEnabled: true,
  onSelectionChanged: (selected) {
    print('Selected: ${selected.length} items');
  },
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

Drag & Drop #

AdvancedListView<Contact>(
  items: contacts,
  allowReorder: true,
  onReorder: (oldIndex, newIndex) {
    // Handle reorder
    final item = contacts.removeAt(oldIndex);
    contacts.insert(newIndex, item);
  },
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

A-Z Index Bar #

AdvancedListView<Contact>(
  items: contacts,
  showIndexBar: true,
  onIndexTap: (letter) {
    // Jump to section starting with letter
    print('Jumped to: $letter');
  },
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

Swipe Actions #

AdvancedListView<Contact>(
  items: contacts,
  // Leading actions (swipe right)
  leadingActions: (context, contact, index) => [
    Icon(Icons.star, color: Colors.white),
  ],
  // Trailing actions (swipe left)
  trailingActions: (context, contact, index) => [
    Icon(Icons.delete, color: Colors.white),
  ],
  // Handle swipe events
  onLeadingSwipe: (contact, index) {
    print('Starred: ${contact.name}');
  },
  onTrailingSwipe: (contact, index) {
    // Remove from list
    contacts.removeAt(index);
  },
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

Pull to Refresh #

AdvancedListView<Contact>(
  items: contacts,
  onRefresh: () async {
    // Refresh data
    await fetchContacts();
  },
  itemBuilder: (context, contact, index, constraints) {
    return ContactCard(contact: contact);
  },
)

API Reference #

AdvancedListView #

Parameter Type Description
items List<T> The list of items to display
itemBuilder Widget Function(...) Builder for creating item widgets
layoutMode LayoutMode Layout mode: auto, list, or grid
gridDelegate SliverGridDelegate? Custom grid delegate
minItemWidth double? Minimum item width for auto mode
isLoading bool Shows skeleton when true
skeletonBuilder WidgetBuilder? Custom skeleton builder
skeletonCount int Number of skeleton items
sortComparator int Function(T, T)? Sorting comparator
sortOrderAscending bool Sort order
allowReorder bool Enable drag & drop
onReorder void Function(int, int)? Reorder callback
showIndexBar bool Show A-Z index bar
onIndexTap ValueChanged<String>? Index tap callback
multiSelectEnabled bool Enable multi-select
singleSelectEnabled bool Enable single-select
onSelectionChanged ValueChanged<Set<T>>? Multi-select callback
onSelected ValueChanged<T?>? Single-select callback
onRefresh Future<void> Function()? Pull to refresh callback
leadingActions List<Widget> Function(...)? Leading swipe actions (icons/widgets)
trailingActions List<Widget> Function(...)? Trailing swipe actions (icons/widgets)
onLeadingSwipe void Function(T, int)? Callback when swiped right
onTrailingSwipe void Function(T, int)? Callback when swiped left
emptyWidget Widget? Widget shown when empty
errorWidget Widget? Widget shown on error
scrollController ScrollController? Scroll controller
physics ScrollPhysics? Scroll physics
padding EdgeInsets? List padding

LayoutMode #

  • LayoutMode.auto - Automatically switches based on screen size
  • LayoutMode.list - Always use list layout
  • LayoutMode.grid - Always use grid layout

Responsive Breakpoints #

  • Mobile: < 600px → List (1 column)
  • Tablet: ≥ 600px && < 1024px → Grid (2 columns)
  • Desktop: ≥ 1024px → Grid (3+ columns)

Example App #

See the example/ directory for a complete demo app showcasing all features.

Run the example:

cd example
flutter run

Contributing #

Contributions are welcome! Please feel free to submit a Pull Request.

License #

MIT License - see LICENSE file for details.

Author #

Created with ❤️ for the Flutter community.

0
likes
150
points
52
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A universal, adaptive list view widget with automatic layout switching, skeleton loading, drag & drop, A-Z jump bar, selection modes, swipe actions, and responsive design.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on ajit_listview