패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소ChanukaUOJ/extendable_dropdown

확장 가능한 드롭다운

다중 드롭다운 처리를 위한 dart 패키지

확장 가능한 드롭다운 프로젝트 이미지
스타
2
포크
0
최근 푸시(UTC)
2026. 4. 22.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

ExtendableDropdown

A Versatile Flutter Package for Dynamic, Generic Dropdown Menus (v1.0.4)

Introducing ExtendableDropdown, a production-ready Flutter package that empowers you to create dynamic and expandable multiple dropdown menus with full support for generic data types.

🚀 Key Features

  • Generic Type Support: Handle any data type (T) with full type safety. No longer restricted to strings!
  • Dynamic Slot Management: Add or remove dropdown slots on the fly with a simple, intuitive UI.
  • Dismissible Interaction: Swipe-to-dismiss functionality for removing selections with item return logic.
  • labelBuilder API: Complete control over how your custom objects are rendered as text in the dropdown.
  • Configurable UI Fragments: Pass your own Widgets for the Add Button and custom callbacks for message handling.
  • Fully Mutable-Safe: Built with immutability in mind, following Flutter's best practices for widget design.

📦 Installation

Add extendable_dropdown as a dependency in your pubspec.yaml file:

dependencies:
  extendable_dropdown: ^1.0.4

Import the package in your Flutter code:

import 'package:extendable_dropdown/extendable_dropdown.dart';

🛠 Usage

Simple Usage (Strings)
List<String> cities = ['Colombo', 'Kandy', 'Galle', 'Jaffna'];

ExtendableDropdown<String>(
  list: cities,
  onSendListChanged: (selectedItems) {
    print('Selected cities: $selectedItems');
  },
)
Advanced Usage (Custom Objects & UI)

You can use any custom model and fully override the UI.

ExtendableDropdown<Location>(
  list: myLocationList,
  onSendListChanged: (selected) => print(selected),
  labelBuilder: (location) => location.name,
  // Completely custom add button
  addButton: ElevatedButton.icon(
    onPressed: null, // Logic is handled internally
    icon: Icon(Icons.add),
    label: Text("Add Location"),
  ),
  // Custom notification logic
  onMessage: (context, message) {
    MyCustomToast.show(message);
  },
)

🎨 Professional Customization

ExtendableDropdown comes with a wide range of styling options:

Property Description Default
list The initial list of items to choose from. Required
onSendListChanged Callback triggered when the selection changes. Required
labelBuilder Function to map generic items to strings. item.toString()
addButton Widget: Custom widget for the add button. Styled default button
onMessage Callback: Handle custom alerts/notifications. Default SnackBar
dismissibleBackgroundColor Color shown when swiping to delete. Colors.red
selectedIcon Icon shown for a selected slot. Icons.radio_button_checked
nonSelectedIcon Icon shown for an empty slot. Icons.location_on_outlined
dropdownBorderRadius Border radius of the dropdown container. 10.0
Check out the [example](file:///Users/mymac/Documents/MyProjects/extendable_dropdown/example/lib/main.dart) folder for a full implementation!

🚧 Roadmap

  • [x] Generic data type support (Completed)
  • [x] Improved state management and immutability (Completed)
  • [ ] Searchable dropdown options
  • [ ] Multi-select within a single dropdown slot
  • [ ] Custom animation support for slot addition

🤝 Contributing

We welcome your feedback and contributions! Please feel free to open issues or submit pull requests.

📄 License

This project is licensed under the MIT License - see the [LICENSE](file:///Users/mymac/Documents/MyProjects/extendable_dropdown/LICENSE) file for details.


Made with ❤️ by Chanuka Ranathunga

Chanuka Ranathunga GitHub avatar
GitHub 작성자

Chanuka Ranathunga ↗

sri lanka
언어DartC++CMakeSwiftShellCHTMLObjective-CJavaKotlin

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개

  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^4.0.0

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗