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

패키지 상세v2.0.0

extendable_dropdown

ExtendableDropdown는 동적이고 사용자 정의 가능한 드롭다운 메뉴를 위한 유연한 Flutter 패키지입니다

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
35
좋아요
2
Pub 점수
155

패키지 설치

flutter pub add extendable_dropdown

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

ExtendableDropdown는 여러 플랫폼에서 동적이고 사용자 정의 가능한 드롭다운 메뉴를 생성할 수 있는 유연한 Flutter 패키지입니다. 단일 선택과 다중 선택을 모두 지원하며, 개발자가 드롭다운의 외관과 동작을 쉽게 맞춤설정할 수 있습니다. Flutter 앱에 원활하게 통합되어 부드러운 애니메이션과 반응형 디자인을 제공합니다. Android, iOS, Web, macOS, Windows, Linux를 지원하여 다양한 기기 간 일관된 사용자 경험을 보장합니다. 양식, 필터 및 설정 인터페이스에 적합하며 직관적인 상호작용 패턴을 통해 사용성을 향상시킵니다.

사용 사례

  • 폼 입력
  • 데이터 필터링
  • 사용자 선호 사항
  • 설정 패널
  • 동적 선택 목록
  • 다중 선택 드롭다운

주요 기능

  • 사용자 지정 스타일
  • 다중 선택 지원
  • 부드러운 애니메이션
  • 크로스 플랫폼 호환성
  • 반응형 디자인
  • 간편한 통합

적합한 대상

  • 양식을 개발하는 개발자
  • 유연성을 원하는 UI 디자이너
  • 동적 필터링이 필요한 앱
  • 크로스 플랫폼 Flutter 프로젝트
  • 인터랙티브 사용자 인터페이스

고려 사항

  • 복잡한 레이아웃을 위해 추가 스타일링이 필요할 수 있습니다
  • 대규모 데이터 세트의 성능 영향
  • 제한된 내장 검증
  • 매우 긴 목록에 최적화되지 않음
  • 신중한 상태 관리가 필요합니다
  • 고급 기능을 위해 외부 종속성에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

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

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.