Git Product home page Git Product logo

contactor_picker's Introduction

contactor_picker

联系人选择器

Getting Started

1 Add [contactor_picker] latest version under dependencies to your package's pubspec.yaml file.

dependencies:
  contactor_picker: ^0.0.7

2 You can install packages from the command line:

$ flutter packages get

3 Api Usage

  • Usage
///列表加搜索
ContactorPicker.showPicker(
                    context,
                    ///数据源
                    dataList: [],
                    ///是否展示code 默认不展示
                    showGroupCode: true,
                    ///选中数据
                    onSelectedData: (data) {

                    },
                    ///标题
                    title: '联系人',
                    ///页面背景色
                    backgroundColor: Color(0xFFFAFAFA),
                    ///当前字母颜色
                    letterSelectedColor: Colors.blueAccent,
                  );
///仅搜索
   ContactorPicker.showSearchPicker(
                    context,
                    ///是否展示code 默认不展示
                    showGroupCode: true,
                    ///不展示
                    dataList: [],
                    ///背景色
                    backgroundColor: Color(0xFFFAFAFA),
                    ///选中数据
                    onSelectedData: (data) {
                    },
                  );
///支持嵌入其他Widget  详见example
 return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: ContactorView(
        ///数据源
        dataList: DataUtil.dataList.map((element) {
          String pinyin = PinyinHelper.getPinyinE(element['name'],
              separator: " ",
              defPinyin: '#',
              format: PinyinFormat.WITHOUT_TONE);
          return ContactorDataListData(
            name: element['name'],
            id: int.tryParse(element['zip']),
            pinyin: pinyin,
            headerImageUrl: 'https://picsum.photos/250?image=9',
            code: element['label'],
            groupCode: element['zip'],
          );
        }).toList(),
        ///选中item时仅选中 不附带pop动作
        canPop: false,
        ///选中回调
        onSelectedData: (ContactorDataListData data) {
          print('${data.toString()}');
        },
      ),
  );

预览

image

contactor_picker's People

Contributors

shinenyok avatar

Stargazers

 avatar droplet avatar

Watchers

 avatar

Forkers

yya5119

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.