lsp_designer

License Pub Codacy Badge

A practical component library from Logistics Service Management Product Group feels silky and smooth when used. 🚀

github

lsp_designer.gif

dependencies:
 lsp_designer: ^0.1.37

Usage example

MultipleSelect

MultipleSelect.showMultipleSelector(
                context,
                dataList: List.generate(15, (index) => MultipleSelectItem.build(value: index, display: '第$index项显示内容', content: '第$index项下拉内容')),
              ).then((selectedList) {
                if (selectedList != null) selectedList.forEach((item) => print(item.display));
              });

MultipleDropDown

List<MultipleSelectItem> elements = List.generate(15, (index) => MultipleSelectItem.build(value: index, display: '$index display', content: '$index content'));

List _selectedValues = elements.where((element) => element.value % 2 == 0).map((item) => item.value).toList();
MultipleDropDown(
          placeholder: '请选择',
          disabled: false,
          values: _selectedValues,
          elements: elements,
          onConfirm: (selectedValues) {
            this.setState(() => this._selectedValues = selectedValues);
          },
        )

SingleElection

SingleElection

SingleElection.build( {@required this.list, @required this.value, @required this.onPressed, this.color});

SingleElectionItem

SingleElectionItem(this.label, this.value);

SingleElection.build(
    value: this._billType,
    color: Colors.orange,
    list: List.generate(
                2,
                (index) =>
                    SingleElectionItem('开单类型' + index.toString(), index.toString())),
    onPressed: (item) =>
        this.setState(() => this._billType = item.value),
)

Selector

Selector( {@required this.value, @required this.label, @required this.hint, @required this.store, @required this.onChange});

Selector(
    value: this._payMode,
    label: Text(
      '付款方式:',
      style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0),
    ),
    hint: Container(
      padding: EdgeInsets.only(left: 10.0),
      child: Text('请选择付款方式'),
    ),
    store: List.generate(
                   5,
                   (index) => DropdownMenuItem(
                         value: '001' + index.toString(),
                         child: Container(
                           padding: EdgeInsets.only(left: 10),
                           child: Text('付款方式' + index.toString()),
                         ),
                       )),
    onChange: (item) => this.setState(() => this._payMode = item),
)

CircularSheet

CircularSheet( {this.head, @required this.child, this.borderRadius, this.height});

CircularSheet(
  head: Text(
    'TITLE',
    style: TextStyle(
      fontSize: 15,
      color: Colors.black45,
    ),
  ),
  child: Container(color: Colors.blue),
)

VagueSelector

  • D 文本框显示的内容
  • V 存储的内容
  • C 下拉列表每行的显示的内容

VagueSelector<D, V, C>

VagueSelector.build( {@required this.label, @required this.list, @required this.onPressed});

SelectorItem<D, V, C>

SelectorItem( {@required this.display, @required this.value, @required this.content});

VagueSelector.build(
    value: this._associateBill,
    label: Text(
      '关联单据:',
      style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0),
    ),
    list: List<SelectorItem>.generate(15, (index) {
      return SelectorItem(
          display: 'AB-190517' + index.toString(),
          value: '190517' + index.toString(),
          content: '单据:AB-190517' + index.toString());
    }),
    onPressed: (value) {
      this.setState(() => this._associateBill = value);
    },
)

Contribute

We would ❤️ to see your contribution!

License

Distributed under the MIT license. See LICENSE for more information.

About

Created by Shusheng.

Libraries

CircularSheet
DialogHolder
DynamicListView
LoadingProcess
NumberField
Selector
SingleElection
Snack
VagueSelector
multi_drop_down
multiple_select