FLUTTER ECOSYSTEM

HussainTaj-W/flutter-package-selection_menu

リスト内のアイテムから項目を選択するための、非常にカスタマイズ可能なFlutterウィジェットです。

flutter-package-selection_menu のプロジェクト画像
Stars
33
Forks
11
最終プッシュ(UTC)
2022/05/24
プロジェクト状態
公開中
Hussain Taj GitHub avatar
GITHUB User

Hussain Taj ↗

Software Engineer

言語Dart

技術トピック

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件
  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

selection_menu

A highly customizable selection/select menu to choose an item from a list, with optional search feature.

Getting Started

The package provides two libraries:

  • selection_menu: Provides Widgets
  • components_configurations: Provides styles(ComponentsConfigurations) for Widgets

The image shows the same SelectionMenu Widget with three different ComponentsConfigurations.

Select Menu in different styles

Basic Usage
import 'package:selection_menu/selection_menu.dart';

SelectionMenu<String>(
    itemsList: <String>['A','B','C'],
    onItemSelected: (String selectedItem)
    {
      print(selectedItem);
    },
    itemBuilder: (BuildContext context, String item, OnItemTapped onItemTapped)
    {
       return Material(
         InkWell(
           onTap: onItemTapped,
           child: Text(item),
         ),
       ); 
    },
    // other Properties...
);

Using A ComponentsConfiguration

import 'package:selection_menu/selection_menu.dart';

// IMPORT this package to get access to configuration classes.
import 'package:selection_menu/components_configurations.dart';

SelectionMenu<String>(
  itemsList: <String>['A','B','C'],
  onItemSelected: (String selectedItem)
  {
    print(selectedItem);
  },
  itemBuilder: (BuildContext context, String item, OnItemTapped onItemTapped)
  {
    return Material(
      InkWell(
        onTap: onItemTapped,
        child: Text(item),
      ),
    );
  },
  componentsConfigurations: DropdownComponentsConfigurations<String>(),
);

Customization

The menu is divided into parts called Components which allows to change one part while the others remain intact.

A ComponentsConfiguration is simply a container for all Components and configurations.

https://i.imgur.com/QL67eib.jpg

Reading the examples is recommended because there are a lot of things to cover and an intro page shouldn't be that long.

Examples

A series of examples can be found here.

Contributions

You may make changes and open pull requests on GitHub. :)