v2.0.2selection_menu
트리거를 터치하여 열고 닫을 수 있는 매우 사용자 정의 가능한 선택/선택 메뉴이며, 선택적으로 검색 기능을 제공합니다.
리스트에서 항목을 선택하기 위해 매우 사용자 정의 가능한 플러터 위젯입니다.
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A highly customizable selection/select menu to choose an item from a list, with optional search feature.
The package provides two libraries:
The image shows the same SelectionMenu Widget with three different ComponentsConfigurations.
Select Menu in different styles
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>(),
);
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.
Reading the examples is recommended because there are a lot of things to cover and an intro page shouldn't be that long.
A series of examples can be found here.
You may make changes and open pull requests on GitHub. :)