Skip to content

Zaveri21/flutter_infinite_dropdown

Repository files navigation

This Flutter package helps create a dropdown which is fully customized And also provides a feature pagination.

GitHub: Zaveri21

✨ Features

  • ⭐️ custom loader in dropdown.
  • ⭐️ customized dropdown list item.
  • ⭐️ pagination support.
  • ⭐️ each item divider optional support.
Android iOS
Android iOS

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_infinite_dropdown: ^1.0.0
import 'package:flutter_infinite_dropdown/flutter_infinite_dropdown.dart';

Usage

To use this package, add flutter_infinite_dropdown as a dependency in your pubspec.yaml file. And add this import to your file to import 'package:flutter_infinite_dropdown/flutter_infinite_dropdown.dart';

// Usage Example
Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
    InfiniteDropdown(
        controller: controller,
        sourceWidget: Container(
        width: 200,
        height: 40,
        color: Colors.blue,
        child: Center(
            child: Text(
            'Tap here to open dropdown',
            style: TextStyle(color: Colors.white),
            ),
        ),
        ),
        data: lsData,
        itemBuilder: (context, index) => ListTile(
        title: Text('Option $index'),
        onTap: () {
            print('Option 1 selected');
        },
        ),
        onBottomRefresh: () async {
            try {
                    Future.delayed(Duration(seconds: 2), () {
                    lsData.addAll(['11', '12', '13', '14', '15', '16', '17', '18', '19', '20']);
                    
                    controller.stopLoading();// <--- Stop loader
                    });
                } catch (ex) {
                     print("Error: $ex");
                }
            },
            dropdownWidget: Container(),
        )
    ],
)

⏳ Work-in-Progress (WIP)

  • 🖥️ Web support (WIP).

Additional information

Buy Me A Coffee

GitHub:Zaveri21

License

License

About

Customised, User-Friendly Dropdown with Pagination

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published