cascade_picker 0.0.3 cascade_picker: ^0.0.3 copied to clipboard
级联选择器
cascade_picker #
级联选择器
Usage #
1. Depend
Add this to you package's pubspec.yaml
file:
dependencies:
cascade_picker: ^0.0.3
2. Install
Run command:
$ flutter packages get
3. Import
Import in Dart code:
import 'package:cascade_picker/cascade_picker.dart';
4. Show
/// initialPageData: 第一页的数据
/// nextPageData: 下一页的数据,点击当前页的选择项后加载下一页
/// controller: 控制器,用于获取已选择的数据
/// maxPageNum: 最大页数
///
/// final _cascadeController = CascadeController();
///
/// CascadePicker(
/// initialPageData: ['a', 'b', 'c', 'd'],
/// nextPageData: (callback, currentPage, selectIndex) async {
/// return ['one', 'two', 'three']
/// },
/// controller: _cascadeController,
/// maxPageNum: 4,
/// )
///
/// InkBox(
/// child: Container(...)
/// onTap: () {
/// if (_cascadeController.isCompleted()) {
/// List<String> selectedTitles = _cascadeController.selectedTitles;
/// List<int> selectedIndexes = _cascadeController.selectedIndexes;
/// }
/// }
/// )