├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── android
├── .project
└── app
│ ├── .project
│ └── bin
│ └── .project
├── doc
├── en
│ ├── actionSheet.md
│ ├── addressEdit.md
│ ├── addressList.md
│ ├── avatar.md
│ ├── badge.md
│ ├── button.md
│ ├── calendar.md
│ ├── card.md
│ ├── cell.md
│ ├── checkbox.md
│ ├── circle.md
│ ├── collapse.md
│ ├── contactCard.md
│ ├── coupon.md
│ ├── dialog.md
│ ├── divider.md
│ ├── field.md
│ ├── goodsAction.md
│ ├── imagePreview.md
│ ├── imageWall.md
│ ├── list.md
│ ├── loading.md
│ ├── noticeBar.md
│ ├── numberKeyboard.md
│ ├── pagination.md
│ ├── panel.md
│ ├── passwordInput.md
│ ├── picker.md
│ ├── price.md
│ ├── progress.md
│ ├── radio.md
│ ├── rate.md
│ ├── search.md
│ ├── shareSheet.md
│ ├── sidebar.md
│ ├── skeleton.md
│ ├── stepper.md
│ ├── steps.md
│ ├── submitBar.md
│ ├── swipe.md
│ ├── tag.md
│ └── treeSelect.md
└── zh
│ ├── actionSheet.md
│ ├── addressEdit.md
│ ├── addressList.md
│ ├── avatar.md
│ ├── badge.md
│ ├── button.md
│ ├── calendar.md
│ ├── card.md
│ ├── cell.md
│ ├── checkbox.md
│ ├── circle.md
│ ├── collapse.md
│ ├── contactCard.md
│ ├── coupon.md
│ ├── dialog.md
│ ├── divider.md
│ ├── field.md
│ ├── goodsAction.md
│ ├── imagePreview.md
│ ├── imageWall.md
│ ├── list.md
│ ├── loading.md
│ ├── noticeBar.md
│ ├── numberKeyboard.md
│ ├── pagination.md
│ ├── panel.md
│ ├── passwordInput.md
│ ├── picker.md
│ ├── price.md
│ ├── progress.md
│ ├── radio.md
│ ├── rate.md
│ ├── search.md
│ ├── shareSheet.md
│ ├── sidebar.md
│ ├── skeleton.md
│ ├── stepper.md
│ ├── steps.md
│ ├── submitBar.md
│ ├── swipe.md
│ ├── tag.md
│ └── treeSelect.md
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── app
│ │ ├── .classpath
│ │ ├── .project
│ │ ├── .settings
│ │ │ └── org.eclipse.buildship.core.prefs
│ │ ├── build.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── club
│ │ │ │ └── flutterchina
│ │ │ │ └── flutterinaction
│ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── settings_aar.gradle
├── i18n
│ ├── en-US.json
│ └── zh-CN.json
├── i18nconfig.json
├── imgs
│ └── avatar.png
├── ios
│ ├── File.swift
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ ├── Flutter.podspec
│ │ ├── Release.xcconfig
│ │ └── flutter_export_environment.sh
│ ├── Podfile
│ ├── Runner-Bridging-Header.h
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Runner
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── main.m
├── lib
│ ├── generated
│ │ └── i18n.dart
│ ├── main.dart
│ ├── routes
│ │ ├── demoActionSheet.dart
│ │ ├── demoAddressEdit.dart
│ │ ├── demoAddressList.dart
│ │ ├── demoAvatar.dart
│ │ ├── demoBadge.dart
│ │ ├── demoButton.dart
│ │ ├── demoCalendar.dart
│ │ ├── demoCard.dart
│ │ ├── demoCell.dart
│ │ ├── demoCheckbox.dart
│ │ ├── demoCircle.dart
│ │ ├── demoCollapse.dart
│ │ ├── demoContactCard.dart
│ │ ├── demoCoupon.dart
│ │ ├── demoDialog.dart
│ │ ├── demoDivider.dart
│ │ ├── demoField.dart
│ │ ├── demoGoodsAction.dart
│ │ ├── demoImage.dart
│ │ ├── demoImagePreview.dart
│ │ ├── demoImageWall.dart
│ │ ├── demoList.dart
│ │ ├── demoLoading.dart
│ │ ├── demoNoticeBar.dart
│ │ ├── demoNumberKeyboard.dart
│ │ ├── demoPagination.dart
│ │ ├── demoPanel.dart
│ │ ├── demoPasswordInput.dart
│ │ ├── demoPicker.dart
│ │ ├── demoPrice.dart
│ │ ├── demoProgress.dart
│ │ ├── demoRadio.dart
│ │ ├── demoRate.dart
│ │ ├── demoSearch.dart
│ │ ├── demoShareSheet.dart
│ │ ├── demoSidebar.dart
│ │ ├── demoSkeleton.dart
│ │ ├── demoStepper.dart
│ │ ├── demoSteps.dart
│ │ ├── demoSubmitBar.dart
│ │ ├── demoSwipe.dart
│ │ ├── demoTag.dart
│ │ ├── demoTreeSelect.dart
│ │ └── index.dart
│ └── utils
│ │ └── index.dart
└── pubspec.yaml
├── imgs
├── addressList.gif
├── button.gif
├── cell.gif
├── field.gif
├── imageWall.gif
├── passwordInput.gif
├── steps.gif
└── treeSelect.gif
├── lib
├── main.dart
├── theme
│ └── style.dart
└── widgets
│ ├── actionSheet.dart
│ ├── addressEdit.dart
│ ├── addressList.dart
│ ├── avatar.dart
│ ├── badge.dart
│ ├── button.dart
│ ├── calendar.dart
│ ├── card.dart
│ ├── cell.dart
│ ├── cellGroup.dart
│ ├── checkbox.dart
│ ├── checkboxGroup.dart
│ ├── collapse.dart
│ ├── collapseItem.dart
│ ├── contactCard.dart
│ ├── coupon.dart
│ ├── dialog.dart
│ ├── divider.dart
│ ├── field.dart
│ ├── goodsAction.dart
│ ├── imagePreview.dart
│ ├── imageWall.dart
│ ├── list.dart
│ ├── loading.dart
│ ├── noticeBar.dart
│ ├── numberKeyboard.dart
│ ├── pagination.dart
│ ├── panel.dart
│ ├── passwordInput.dart
│ ├── picker.dart
│ ├── price.dart
│ ├── progress.dart
│ ├── radioGroup.dart
│ ├── rate.dart
│ ├── search.dart
│ ├── shareSheet.dart
│ ├── sidebar.dart
│ ├── skeleton.dart
│ ├── stepper.dart
│ ├── steps.dart
│ ├── submitBar.dart
│ ├── swipe.dart
│ ├── tag.dart
│ └── treeSelect.dart
└── pubspec.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | /# Miscellaneous
2 | *.class
3 | *.lock
4 | *.log
5 | *.pyc
6 | *.swp
7 | .DS_Store
8 | .atom/
9 | .buildlog/
10 | .history
11 | .svn/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # Visual Studio Code related
20 | .vscode/
21 |
22 | # Flutter/Dart/Pub related
23 | **/doc/api/
24 | .dart_tool/
25 | .flutter-plugins
26 | .packages
27 | .pub-cache/
28 | .pub/
29 | build/
30 |
31 | # Android related
32 | **/android/**/gradle-wrapper.jar
33 | **/android/.gradle
34 | **/android/captures/
35 | **/android/gradlew
36 | **/android/gradlew.bat
37 | **/android/local.properties
38 | **/android/**/GeneratedPluginRegistrant.java
39 |
40 | # iOS/XCode related
41 | **/ios/**/*.mode1v3
42 | **/ios/**/*.mode2v3
43 | **/ios/**/*.moved-aside
44 | **/ios/**/*.pbxuser
45 | **/ios/**/*.perspectivev3
46 | **/ios/**/*sync/
47 | **/ios/**/.sconsign.dblite
48 | **/ios/**/.tags*
49 | **/ios/**/.vagrant/
50 | **/ios/**/DerivedData/
51 | **/ios/**/Icon?
52 | **/ios/**/Pods/
53 | **/ios/**/.symlinks/
54 | **/ios/**/profile
55 | **/ios/**/xcuserdata
56 | **/ios/.generated/
57 | **/ios/Flutter/App.framework
58 | **/ios/Flutter/Flutter.framework
59 | **/ios/Flutter/Generated.xcconfig
60 | **/ios/Flutter/app.flx
61 | **/ios/Flutter/app.zip
62 | **/ios/Flutter/flutter_assets/
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 5391447fae6209bb21a89e6a5a6583cac1af9b4b
8 | channel: beta
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # CHANGELOG
2 |
3 | ## 0.3.0
4 | - Add share sheet and contact card;
5 | - Fix demo;
6 |
7 | ## 0.2.7
8 |
9 | - Upgrade to flutter2;
10 | - Support null safety;
11 |
12 | ## 0.2.5
13 |
14 | - Chore list;
15 | - Update docs;
16 |
17 | ## 0.2.0
18 |
19 | - Add calendar and picker;
20 | - Fix some components bugs;
21 |
22 | ## 0.1.7
23 |
24 | - Organize documents;
25 | - Adjust code structure;
26 |
27 | ## 0.1.0
28 |
29 | - Initial version;
30 | - Update README;
31 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Nero Chen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ```
2 | 此项目仅供本人学习用,更新频率慢,若在项目中使用请移步到其它成熟的组件库
3 | This project is only for my own study, the update frequency is slow and untested, if you use it in the project, please move to other mature component libraries
4 | ```
5 |
6 | # Flutter Vant Kit
7 |
8 | Flutter Vant Kit is a [Vant](https://youzan.github.io/vant/#/zh-CN/intro) style flutter UI library.
9 |
10 | ## Introduction
11 |
12 | ### How to use
13 |
14 | ```
15 | dependencies:
16 | flutter_vant_kit: ^0.3.0
17 | ```
18 |
19 | ### How to run demo
20 |
21 | ```
22 | cd example/
23 | flutter run
24 | ```
25 |
26 | ## API
27 |
28 | View [Documentation](https://benjaken.gitbook.io/flutter-vant-kit) 或 【[中文版](./doc/zh)|[English](./doc/en)】
29 |
30 | ## Demo Screenshot
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/android/app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | app
4 | Project app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/android/app/bin/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | app
4 | Project app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/doc/en/actionSheet.md:
--------------------------------------------------------------------------------
1 | ## ActionSheet
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List actionList = [
9 | ActionSheetItem(name: "Option"),
10 | ...
11 | ];
12 |
13 | ActionSheet(
14 | actions: actionList
15 | ).show(context);
16 | ```
17 |
18 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoActionSheet.dart)
19 |
20 | ### API
21 |
22 | #### ActionSheetItem
23 |
24 | | Attribute | Description | Type | Default |
25 | | ------------ | ------------ | ------------ | ------------ |
26 | | name | Title | `String` | - |
27 | | subname | Subtitle | `String` | - |
28 | | color | Text color | `Color` | `#323233` |
29 | | loading | Whether to be loading status | `bool` | `false` |
30 | | disabled | Whether to be disabled | `bool` | `false` |
31 |
32 | #### ActionSheet
33 |
34 | | Attribute | Description | Type | Default |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | actions | Options | `List` | - |
37 | | title | Title | `String` | - |
38 | | cancelText | Text of cancel button | `String` | - |
39 | | description | Description above the options | `String` | - |
40 | | round | Whether to show round corner | `bool` | `true` |
41 | | closeIcon | Close icon | `IconData` | - |
42 | | closeOnClickOverlay | Whether to close when click overlay | `bool` | `true` |
43 | | onSelect | Triggered when click option | `Function(ActionSheetItem actionSheetItem, int index, BuildContext context)` | - |
44 | | onCancel | Triggered when the cancel button is clicked | `Function()` | - |
45 | | onClose | Triggered when the menu is closed | `Function()` | - |
46 | | child | custom menu content | `Widget` | - |
47 |
--------------------------------------------------------------------------------
/doc/en/addressEdit.md:
--------------------------------------------------------------------------------
1 | ## AddressEdit
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | AddressEdit(
9 | showDelete: true,
10 | showSetDefault: true,
11 | addressInfo: {
12 | "name": "Zhang San",
13 | "tel": "18345234123",
14 | "province": "Guangdong",
15 | "city": "Shen Zhen",
16 | "county": "Nan Shan",
17 | "provinceId": 0,
18 | "cityId": 1,
19 | "countyId": 0,
20 | "addressDetail": "MingZhu Garden",
21 | "postalCode": "515000",
22 | "isDefault": true
23 | },
24 | ...
25 | )
26 | ```
27 |
28 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoAddressEdit.dart)
29 |
30 | ### API
31 |
32 | #### AddressEdit
33 |
34 | | Attribute | Description | Type | Default |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | areaColumnsPlaceholder | placeholder of area columns | `String` | `Select province / city / district` |
37 | | addressInfo | Address Info | `Map` | - |
38 | | showPostal | Whether to show postal code | `bool` | `true` |
39 | | showDelete | Whether to show the delete button | `bool` | `false` |
40 | | showSetDefault | Whether to show the default address bar | `bool` | `false` |
41 | | saveButtonText | Save button text | `String` | `save` |
42 | | deleteButtonText | Delete button text | `String` | `delete` |
43 | | detailRows | Number of detail address input lines | `int` | `1` |
44 | | detailMaxlength | Max address length | `int` | `200` |
45 | | children | Custom Content | `List` | - |
46 | | onSave | Triggered when click the save button | `Function(Map map)` | - |
47 | | onDelete | Triggered when delete the address | `Function(Map map)` | - |
48 | | onCancelDelete | Triggered when cancel an address | `Function(Map map)` | - |
49 |
50 | #### AddressInfo
51 |
52 | | Attribute | Description | Type |
53 | | ------------ | ------------ | ------------ |
54 | | name | Name | `String` |
55 | | tel | Mobile number | `String` |
56 | | province | Province name | `String` |
57 | | city | City name | `String` |
58 | | county | County name | `String` |
59 | | provinceId | Province id | `int` |
60 | | cityId | City id | `int` |
61 | | countyId | County id | `int` |
62 | | addressDetail | Address detail | `String` |
63 | | postalCode | Postal code | `String` |
64 | | isDefault | Whether to be default address | `bool` |
65 |
--------------------------------------------------------------------------------
/doc/en/addressList.md:
--------------------------------------------------------------------------------
1 | ## AddressList
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | AddressInfo(
10 | name: "Zhang San",
11 | tel: "18345234123",
12 | province: "Guangdong",
13 | city: "Shenzhen",
14 | county: "Nanshan",
15 | "provinceId": 0,
16 | "cityId": 1,
17 | "countyId": 0,
18 | addressDetail: "Mingzhu Garden",
19 | postalCode: "515000",
20 | isDefault: true
21 | )
22 | ]
23 |
24 | AddressList(
25 | id: 0,
26 | list: list,
27 | disabledList: disabledList,
28 | ...
29 | )
30 | ```
31 |
32 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoAddressList.dart)
33 |
34 | ### API
35 |
36 | #### AddressList
37 |
38 | | Attribute | Description | Type | Default |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | id | Current selected address id | `int` | - |
41 | | list | Address List | `List` | - |
42 | | disabledList | Disabled address list | `List` | - |
43 | | disabledText | Disabled text | `String` | `The following address is out of scope of delivery` |
44 | | switchable | Whether to allow switch address | `bool` | `true` |
45 | | addButtonText | Add button text | `String` | `Add Address` |
46 | | defaultTagText | Default tag text | `String` | `default` |
47 | | onAdd | Triggered when click add button | `Function()` | - |
48 | | onEdit | Triggered when click edit button | `Function(AddressInfo info, int i)` | - |
49 | | onSelect | Triggered when select address | `Function(AddressInfo info, int i)` | - |
50 | | top | Insert content at the top | `Widget` | - |
51 | | children | Insert content below the list | `Widget` | - |
52 |
53 | #### AddressInfo
54 |
55 | | Attribute | Description | Type |
56 | | ------------ | ------------ | ------------ |
57 | | name | Name | `String` |
58 | | tel | Mobile number | `String` |
59 | | province | Province name | `String` |
60 | | city | City name | `String` |
61 | | county | County name | `String` |
62 | | provinceId | Province id | `int` |
63 | | cityId | City id | `int` |
64 | | countyId | County id | `int` |
65 | | addressDetail | Address detail | `String` |
66 | | postalCode | Postal code | `String` |
67 | | isDefault | Whether to be default address | `bool` |
68 |
--------------------------------------------------------------------------------
/doc/en/avatar.md:
--------------------------------------------------------------------------------
1 | ## Avatar
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Avatar(
9 | type: 'large'
10 | ...
11 | )
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoAvatar.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | type | Avatar type, can be set to `large``small` | `String` | `normal` |
21 | | size | Avatar size, priority is higher than the size of `type` | `double` |-|
22 | | shape | Avatar shape, can be set to `square` | `String` | `round` |
23 | | color | Avatar background color | `Color` | `#ebedf0` |
24 | | iconColor | Avatar Icon Color | `Color` | `#323233` |
25 | | custom | Custom icon content | `Widget` |-|
26 | | image | Avatar picture content | `ImageProvider` |-|
27 | | onClick | Callback after clicking on the avatar | `Function()` |-|
28 |
--------------------------------------------------------------------------------
/doc/en/badge.md:
--------------------------------------------------------------------------------
1 | ## Badge
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Badge(
9 | value: "10",
10 | child: ...,
11 | ),
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master//example/lib/routes/demoBadge.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | value | Content | `String` | - |
21 | | dot | Whether to show red dot | `bool` | `false` |
22 | | max | Max value,show `{max}+` when exceed,only works when `value` is number | `int` | - |
23 | | color | Custom color | `Color` | `#ee0a24` |
24 | | textColor | Custom cext color | `Color` | `#ffffff` |
25 | | textSize | Custom text size | `double` | `12.0` |
26 | | child | Custom badge | `Widget` | - |
27 | | content | Custom badge content | `Widget` | - |
28 |
--------------------------------------------------------------------------------
/doc/en/button.md:
--------------------------------------------------------------------------------
1 | ## Button
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NButton(
9 | text: "Button",
10 | type: "primary",
11 | ...
12 | ),
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoButton.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | type | Button type, can be set to `primary` `info` `danger` `warning` | `String` | `default` |
22 | | size | Button Size, can be set to `large` `small` `mini` | `String` | `normal` |
23 | | text | Button Text | `String` | - |
24 | | width | Button Width | `double` | - |
25 | | height | Button Height | `double` | - |
26 | | color | Color, support linear-gradient | `Color || Gradient` | - |
27 | | icon | Left Icon | `Icon` | - |
28 | | textColor | Button Text Color | `Color` | - |
29 | | block | Whether to set display block | `bool` | `false` |
30 | | plain | Whether to be plain button | `bool` | `false` |
31 | | square | Whether to be square button | `bool` | `false` |
32 | | round | Whether to be round button | `bool` | `false` |
33 | | disabled | Whether to disable button | `bool` | `false` |
34 | | loading | Whether to show loading status | `bool` | `false` |
35 | | hairline | Whether to use 0.5px border | `bool` | `false` |
36 | | padding | Custom Padding | `EdgeInsets` | - |
37 | | borderRadius | Custom Broder Radius | `BorderRadius` | - |
38 | | onClick | Triggered when click button and not disabled or loading | `Function()` | - |
39 |
--------------------------------------------------------------------------------
/doc/en/calendar.md:
--------------------------------------------------------------------------------
1 | ## Calendar
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | DateTime selectedDate;
9 |
10 | Calendar(
11 | defaultDate: selectedDate,
12 | ...
13 | ).show(context);
14 | ```
15 |
16 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCalendar.dart)
17 |
18 | ### API
19 |
20 | | Attribute | Description | Type | Default |
21 | | ------------ | ------------ | ------------ | ------------ |
22 | | type | Select type, can be set to `range` | `String` | `single` |
23 | | title | Calendar Title | `String` | `Date Selection` |
24 | | color | Color for the bottom button and selected date | `Color` | `#1989fa` |
25 | | minDate | Min Date | `DateTime` | - |
26 | | maxDate | Max date | `DateTime` | - |
27 | | defaultDate | Default selected date | `DateTime` | - |
28 | | rowHeight | Row height | `double` | - |
29 | | poppable | Whether to show the calendar inside a popup | `bool` | `true` |
30 | | round | Whether to show round corner | `bool` | `true` |
31 | | showMark | Whether to display the background watermark of the month | `bool` | `true` |
32 | | showConfirm | Whether to show the confirmation button | `bool` | `true` |
33 | | closeOnClickOverlay | Whether to close when click overlay | `bool` | `true` |
34 | | confirmText | Confirm button text | `String` | `OK` |
35 | | height | Schedule height, when `poppable = false` | `double` | `400.0` |
36 | | onSelect | Triggered when select date | `Function(DateTime date)` | - |
37 | | onConfirm | Triggered after the date selection is completed, if `showConfirm = true`, it is triggered after clicking the confirm button | `Function(DateTime date)` | - |
38 |
--------------------------------------------------------------------------------
/doc/en/card.md:
--------------------------------------------------------------------------------
1 | ## Card
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NCard(
9 | title: "Product Name",
10 | desc: "Description",
11 | ...
12 | ),
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCard.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | image | Left image | `Image` | - |
22 | | title | Title | `String` | - |
23 | | desc | Description | `String` | - |
24 | | tag | Tag | `String` | - |
25 | | num | Number | `int` | - |
26 | | price | Price | `double` | - |
27 | | originPrice | original price | `double` | - |
28 | | centered | Whether content vertical centered | `bool` | `false` |
29 | | currency | Currency symbol | `String` | `¥`|
30 | | onClick | Triggered when clicked | `Function()` | - |
31 | | customTitle | Custom title | `Widget` | - |
32 | | customDesc | Custom description | `Widget` | - |
33 | | customNum | Custom quantity | `Widget` | - |
34 | | customPrice | Custom price | `Widget` | - |
35 | | customOriginPrice | Custom original price | `Widget` | - |
36 | | customThumb | Custom Pictures | `Widget` | - |
37 | | customTag | Custom picture corner | `Widget` | - |
38 | | customTags | Custom tag area under the description | `Widget` | - |
39 | | customFooter | Custom footer | `Widget` | - |
40 |
--------------------------------------------------------------------------------
/doc/en/cell.md:
--------------------------------------------------------------------------------
1 | ## Cell
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | CellGroup(
9 | children: [
10 | Cell(
11 | title: "Title",
12 | value: "Value"
13 | ...
14 | ),
15 | ]
16 | ),
17 | ```
18 |
19 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCell.dart)
20 |
21 | ### API
22 |
23 | #### CellGroup
24 |
25 | | Attribute | Description | Type | Default |
26 | | ------------ | ------------ | ------------ | ------------ |
27 | | title | Group Title | `String` |-|
28 | | border | Whether to show the outer border | `bool` | `true` |
29 | | decoration | Custom border style | `BoxDecoration` |-|
30 | | children | Default slot | `List` |-|
31 |
32 | #### Cell
33 |
34 | | Attribute | Description | Type | Default |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | title | Left Title | `String` |-|
37 | | label | Descriptive Information under the Title | `String` |-|
38 | | value | Content on the right | `String` |-|
39 | | icon | Left Icon | `IconData` |-|
40 | | size | Cell Size, can be set to `large` | `String` | `normal` |
41 | | require | Whether to display the form required asterisks | `bool` | `false` |
42 | | clickable | Clickable | `bool` | `false` |
43 | | isLink | Whether to show the right arrow and enable click feedback | `bool` | `false` |
44 | | arrowDirection | Arrow direction, can be set to `left`` up` `down` | `String` | `right` |
45 | | customTitle | Custom title content | `Widget` |-|
46 | | customLabel | Custom Description under custom header | `Widget` |-|
47 | | customRight | Custom Right Content | `Widget` |-|
48 | | onClick | triggered when a cell is clicked | `Function()` |-|
49 |
--------------------------------------------------------------------------------
/doc/en/checkbox.md:
--------------------------------------------------------------------------------
1 | ## Checkbox
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | CheckItem(name: "a", text: "Checkbox A"),
10 | CheckItem(name: "b", text: "Checkbox B"),
11 | ...
12 | ];
13 |
14 | CheckboxGroup(
15 | list: list,
16 | ...
17 | )
18 | ```
19 |
20 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCheckbox.dart)
21 |
22 | ### API
23 |
24 | #### CheckGroup
25 |
26 | | Attribute | Description | Type | Default |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | list | Options | `List` | - |
29 | | value | Identifiers of all selected items | `List` | - |
30 | | shape | The shape of all options | `String` | `round` |
31 | | max | Maximum amount of checked options | `int` | `9999` |
32 | | inCellGroup | Whether it is a cell component | `bool` | `false` |
33 | | disabled | Disable all checkboxes | `bool` | `false` |
34 | | iconSize | Icon size for all checkboxes | `double` | |
35 | | checkedColor | Checked state color of all checkboxes | `Color` | - |
36 | | onChange | Triggered when value changed | `Function(List value)` | - |
37 |
38 | #### CheckItem
39 |
40 | | Attribute | Description | Type | Default |
41 | | ------------ | ------------ | ------------ | ------------ |
42 | | name | Checkbox name | `String` | - |
43 | | value | Check status | `bool` | `false` |
44 | | shape | The shape of the option, the optional value is `square` | `String` | `round` |
45 | | text | Option description | `String` | - |
46 | | disabled | Checkbox disabled | `bool` | `false` |
47 | | iconSize | Icon size | `double` | `20` |
48 | | checkedColor | Checked color | `Color` | `#1989fa` |
49 |
--------------------------------------------------------------------------------
/doc/en/circle.md:
--------------------------------------------------------------------------------
1 | ## Circle
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Progress(
9 | type: "circular",
10 | percentage: 30,
11 | ...
12 | ),
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCircle.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | inactive | Inactive | `bool` | `false` |
22 | | percentage | Progress percentage | `double` | `0` |
23 | | strokeWidth | Stroke width | `double` | `5` |
24 | | showPivot | Whether to show pivot | `bool` | `false` |
25 | | color | Progress color | `Color` | `#1989fa` |
26 | | textColor | Progress text color | `Color` | `#ffffff` |
27 | | trackColor | Track Color | `Color` | `#ebedf0` |
28 | | pivotText | Pivot text | `String` | - |
29 | | pivotColor | Pivot color | `Color` | - |
30 | | circularSize | Circular size | `double` | `120` |
31 |
--------------------------------------------------------------------------------
/doc/en/collapse.md:
--------------------------------------------------------------------------------
1 | ## Collapse
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [[
9 | CollapseItem(
10 | title: "Title",
11 | children: [
12 | Text("Content"),
13 | ],
14 | ),
15 | ...
16 | ]
17 |
18 | Collapse(
19 | name: ['0']
20 | list: list,
21 | ...
22 | )
23 | ```
24 |
25 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCollapse.dart)
26 |
27 | ### API
28 |
29 | #### Collapse
30 |
31 | | Attribute | Description | Type | Default |
32 | | ------------ | ------------ | ------------ | ------------ |
33 | | name | Current expanded names | `List ` | - |
34 | | list | Child panel | `List ` | - |
35 | | accordion | Whether to be a accordion | `bool` | `false` |
36 | | border | whether to show the outer border | `bool` | `true` |
37 | | onChange | Triggered when switching panel | `Function(List)` | - |
38 |
39 | #### CollapseItem
40 |
41 | | Attribute | Description | Type | Default |
42 | | ------------ | ------------ | ------------ | ------------ |
43 | | name | Panel identifier | `String` | - |
44 | | isExpanded | Whether to expand | `bool` | `false` |
45 | | icon | Left icon | `IconData` | - |
46 | | title | Title | `String` | - |
47 | | value | Value | `String` | - |
48 | | label | Description | `String` | - |
49 | | rightIcon | Custom Right Icon | `Icon` | - |
50 | | clickable | Clickable | `bool` | `true` |
51 | | customTitle | Custom title | `Widget` | - |
52 | | customLabel | Description under custom header | `Widget` | - |
53 | | content | Panel content | `String` | - |
54 | | children | Custom panel | `List ` | - |
55 | | onExpansionChanged | Triggered after the panel expanded | `Function (bool isExpand)` | - |
56 |
--------------------------------------------------------------------------------
/doc/en/contactCard.md:
--------------------------------------------------------------------------------
1 | ## ContactCard
2 |
3 | ### Example
4 | ```
5 | import 'package:flutter_vant_kit/main.dart';
6 |
7 | ContactCard(
8 | type: 'add'
9 | ...
10 | )
11 | ```
12 |
13 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoContactCard.dart)
14 |
15 | ### API
16 |
17 | | Attribute | Description | Type | Default |
18 | | ------------ | ------------ | ------------ | ------------ |
19 | | type | Can be set to `edit` | `String` | `add` |
20 | | name | Name | `String` | - |
21 | | tel | Phone | `String` | - |
22 | | editAble | Whether it can be edited, when `type=edit` | `bool` | `true` |
23 | | onClick | Emitted when component is clicked | `Function()` | - |
--------------------------------------------------------------------------------
/doc/en/coupon.md:
--------------------------------------------------------------------------------
1 | ## Coupon
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List coupons = [
9 | CouponItem(
10 | condition: 'No usage threshold \nUp to ¥12 discount',
11 | description: 'Description',
12 | ...
13 | )
14 | ]
15 |
16 | Coupon(
17 | chosenCoupon: _chosenCoupon,
18 | coupons: coupons,
19 | disabledCoupons: coupons.sublist(0, 2),
20 | ...
21 | ).show(context);
22 | ```
23 |
24 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCoupon.dart)
25 |
26 | ### API
27 |
28 | #### Coupon
29 |
30 | | Attribute | Description | Type | Default |
31 | | ------------ | ------------ | ------------ | ------------ |
32 | | chosenCoupon | Currently selected coupon | `int` | - |
33 | | coupons | Coupon list | `List` | - |
34 | | disabledCoupons | Disabled coupon list | `List` | - |
35 | | enabledTitle | Title of coupon list | `String` | `Available` |
36 | | disabledTitle | Title of disabled coupon list | `String` | `Unavailable` |
37 | | exchangeButtonText | exchange button text | `String` | `Exchange` |
38 | | exchangeButtonDisabled | Whether to disable the exchange button | `bool` | `false` |
39 | | exchangeMaxLength | Max length to enable exchange button | `int` | `10` |
40 | | displayedCouponIndex | Index of displayed coupon | `int` | - |
41 | | showCloseButton | Whether to show the button at the bottom of the list | `bool` | `true` |
42 | | closeButtonText | Close button text | `String` | `Not using offers` |
43 | | inputPlaceholder | Input placeholder | `String` | `Please enter a discount code` |
44 | | showExchangeBar | Whether to show the exchange bar | `bool` | `true` |
45 | | emptyImage | Placeholder image when list is empty | `Image` | `https://img.yzcdn.cn/vant/coupon-empty.png` |
46 | | onSelect | Triggered when change chosen coupon | `Function(int val)` | - |
47 | | onExchange | Triggered when exchange coupon | `Function(String val)` | - |
48 |
49 | #### CouponItem
50 |
51 | | Attribute | Description | Type | Default |
52 | | ------------ | ------------ | ------------ | ------------ |
53 | | name | Coupon name | `String` | - |
54 | | value | value | `double` | - |
55 | | valueDesc | Value text | `String` | - |
56 | | unitDesc | Unit text | `String` | - |
57 | | condition | Condition | `String` | - |
58 | | startAt | Start time | `String` | - |
59 | | endAt | End time | `String` | - |
60 | | description | Description | `String` | - |
61 | | reason | Unavailable reason | `String` | - |
62 |
--------------------------------------------------------------------------------
/doc/en/dialog.md:
--------------------------------------------------------------------------------
1 | ## Dialog
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NDialog(
9 | title: 'Title',
10 | ...
11 | );
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoDialog.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | title | Popup Title | `String` | - |
21 | | message | popup content | `String` | - |
22 | | titleAlign | Title Alignment | `AlignmentDirectional` | `center` |
23 | | messageAlign | Message alignment | `TextAlign` | `center` |
24 | | showConfirmButton | Whether to show the confirm button | `bool` | `true` |
25 | | showCancelButton | whether to show the cancel button | `bool` | `false` |
26 | | confirmButtonText | Confirm button text | `String` | `Confirm` |
27 | | confirmButtonColor | Confirm button color | `Color` | `#ffffff` |
28 | | confirmTextColor | Confirm button text color | `Color` | `#1989fa` |
29 | | cancelButtonText | Cancel button text | `String` | `Cancel` |
30 | | cancelButtonColor | Cancel button color | `Color` | `#ffffff` |
31 | | cancelTextColor | Cancel button text color | `Color` | `#323233` |
32 | | closeOnClickOverlay | Whether to close the popup window after clicking the mask layer | `bool` | `false` |
33 | | onConfirm | triggered when click the confirm button | `Function()` | - |
34 | | onCancel | Triggered when click the cancel button | `Function()` | - |
35 | | beforeClose | Triggered when the dialog is closed | `Function()` | - |
36 | | child | Custom content | `Widget` | - |
37 |
--------------------------------------------------------------------------------
/doc/en/divider.md:
--------------------------------------------------------------------------------
1 | ## Divider
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NDivider(
9 | content: "Divider",
10 | )
11 | ```
12 |
13 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoDivider.dart)
14 |
15 | ### API
16 |
17 | | Attribute | Description | Type | Default |
18 | | ------------ | ------------ | ------------ | ------------ |
19 | | content | Divider text | `String` | - |
20 | | fontColor | Text color | `Color` | `#969799` |
21 | | fontSize | Text size | `double` | `14` |
22 | | lineColor | Divider color | `Color` | `#ebedf0` |
23 | | hairline | Whether to be hairline | `bool` | `false` |
24 | | contentPosition | Content position | `String` | `center` |
25 | | child | Custom divider content | `Widget` | - |
26 |
--------------------------------------------------------------------------------
/doc/en/field.md:
--------------------------------------------------------------------------------
1 | ## Field
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Field(
9 | placeholder: "Pleace Input User Name",
10 | controller: testInput1,
11 | ...
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoField.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | controller | Control Properties | `TextEditingController` | - |
22 | | keyboardType | Input Type | `TextInputType` | - |
23 | | focusNode | Focus control | `FocusNode` | - |
24 | | textInputAction | Type in the bottom right corner of the keyboard | `TextInputAction` | `done` |
25 | | label | Field label | `String` | - |
26 | | maxLength | Max length of value | `int` | - |
27 | | placeholder | Placeholder | `String` | - |
28 | | disabled | Whether to disable the field | `bool` | `false` |
29 | | readonly | Read-only | `bool` | `false` |
30 | | require | Whether to display the form required asterisks | `bool` | `false` |
31 | | clearable | Whether to enable clear control | `bool` | `true` |
32 | | autofocus | Autofocus | `bool` | `false` |
33 | | inputFormatters | Check field regularity | `List` | - |
34 | | Type | Input Type | `String` | `text` |
35 | | rows | The number of rows in the field when `type = textarea` is available | `int` | `2` |
36 | | showWordLimit | Whether to show word limit, need to set the `maxlength` prop | `bool` | `false` |
37 | | error | Whether to mark the input red | `bool` | `false` |
38 | | errorMessage | Bottom Error Copy | `String` | - |
39 | | labelWidth | Left text width | `double` | `90.0` |
40 | | labelAlign | Left text alignment | `TextAlign` | `start` |
41 | | inputAlign | Input box content alignment | `TextAlign` | `start` |
42 | | leftIcon | Left icon | `IconData` | - |
43 | | clickLeft | Triggered when the left icon is clicked | `Function()` | - |
44 | | rightIcon | Right icon | `IconData` | - |
45 | | clickRight | Triggered when the right icon is clicked | `Function()` | - |
46 | | right | Custom right content | `Widget` | - |
47 | | Toolbar Options | Toolbar Customization | `ToolbarOptions` | - |
48 | | onChange | Triggered when the content of the input box changes | `Function(String val)` | - |
49 | | onEditingComplete | Triggered when editing the content | `Function()` | - |
50 | | onClick | Fires when input box gets focus | `Function()` | - |
51 | | onSubmitted | callback for content submission (press enter) | `Function(String val)` | - |
52 | | style | Text Style | `TextStyle` | - |
53 |
--------------------------------------------------------------------------------
/doc/en/goodsAction.md:
--------------------------------------------------------------------------------
1 | ## GoodsAction 商品导航
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | GoodsAction(
9 | actions: [
10 | ActionButtonItem(text: "Customer service", icon: Icons.chat_bubble_outline),
11 | ...
12 | ],
13 | buttons: [
14 | ButtonItem(
15 | text: "Add to Shopping Cart",
16 | gradient: LinearGradient(colors: [Color(0xffffd01e), Color(0xffff8917)])
17 | ),
18 | ...
19 | ],
20 | )
21 | ```
22 |
23 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoGoodsAction.dart)
24 |
25 | ### API
26 |
27 | #### GoodsAction
28 |
29 | | Attribute | Description | Type | Default |
30 | | ------------ | ------------ | ------------ | ------------ |
31 | | actions | Left icon button | `List ` | - |
32 | | buttons | Right button | `List ` | - |
33 |
34 | #### ActionButtonItem
35 |
36 | | Attribute | Description | Type | Default |
37 | | ------------ | ------------ | ------------ | ------------ |
38 | | text | Button text | `String` | - |
39 | | icon | Icon | `IconData` | - |
40 | | info | Content of the badge | `String` | - |
41 | | onClick | Trigger when clicked | `Function()` | - |
42 | | customIcon | Custom icon | `Widget` | - |
43 | | customText | Custom text | `Widget` | - |
44 |
45 | #### ButtonItem
46 |
47 | | Attribute | Description | Type | Default |
48 | | ------------ | ------------ | ------------ | ------------ |
49 | | text | Button text | `String` | - |
50 | | color | Button color, support linear-gradient | `Color || Gradient` | - |
51 | | disabled | Whether to disable button | `bool` | `false` |
52 | | loading | Whether show loading status | `bool` | `false` |
53 | | onClick | Trigger when clicked | `Function()` | - |
54 | | customText | Custom text | `Widget` | - |
55 |
--------------------------------------------------------------------------------
/doc/en/imagePreview.md:
--------------------------------------------------------------------------------
1 | ## ImagePreview
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List images = [
9 | Image.network("https://img.yzcdn.cn/vant/apple-1.jpg"),
10 | Image.network("https://img.yzcdn.cn/vant/apple-2.jpg"),
11 | ...
12 | ];
13 |
14 | showImagePreview(
15 | context: context,
16 | images: images,
17 | );
18 | ```
19 |
20 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoImagePreview.dart)
21 |
22 | ### API
23 |
24 | | Attribute | Description | Type | Default |
25 | | ------------ | ------------ | ------------ | ------------ |
26 | | images | Images list | `List ` | - |
27 | | startPosition | Start position | `int` | `0` |
28 | | showIndex | Whether to show index | `bool` | `true` |
29 | | showIndicators | Whether to show indicators | `bool` | `false` |
30 | | swipeDuration | Animation duration | `Duration` | `Duration(seconds: 1)`|
31 | | closeable | Whether to show close icon | `bool` | `false`|
32 | | closeIcon | Close icon | `IconData` | -|
33 | | closeIconPosition | Close icon position,can be set to `top-left` `bottom-left` `bottom-right` | `String` | `top-right`|
34 | | onChange | Triggered when current image change | `Function (int val)` | - |
35 | | onClose | Emitted when closing ImagePreview | `Function (int index)` | - |
36 |
--------------------------------------------------------------------------------
/doc/en/imageWall.md:
--------------------------------------------------------------------------------
1 | ## ImageWall
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List images = [
9 | "https://storage.360buyimg.com/mtd/home/111543234387022.jpg",
10 | ...
11 | ];
12 |
13 | ImageWall(
14 | images: images,
15 | count: 6,
16 | ...
17 | )
18 | ```
19 |
20 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoImageWall.dart)
21 |
22 | ### API
23 |
24 | | Attribute | Description | Type | Default |
25 | | ------------ | ------------ | ------------ | ------------ |
26 | | images | Image file array | `List` | - |
27 | | multiple | Whether to select multiple images | `bool` | `false` |
28 | | count | The maximum number of pictures you can select | `int` | `9` |
29 | | imageFit | Picture Preview Style | `BoxFit` | `contain` |
30 | | uploadBtn | Custom button | `Widget` | - |
31 | | onChange | Triggered when after uploading a image | `Function(List images)` | - |
32 | | onUpload | Triggered when upload the image | `Function(List file)` | - |
33 | | onRemove | Triggered when remove the image | `Function(String url)` | - |
34 |
--------------------------------------------------------------------------------
/doc/en/list.md:
--------------------------------------------------------------------------------
1 | ## List
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List _dataList1 = [];
9 | bool _finished1 = false;
10 |
11 | NList(
12 | finished: _finished1,
13 | finishedText: "No more",
14 | child: List.generate(_dataList1.length, (i) => _buildItem(_dataList1[i])),
15 | onLoad: () {
16 | return Future.delayed(const Duration(milliseconds: 300), () {
17 | setState(() {
18 | _dataList1
19 | .addAll(List.generate(10, (i) => i + _dataList1.length));
20 | _finished1 = _dataList1.length >= 40;
21 | });
22 | });
23 | },
24 | )
25 | ```
26 |
27 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoList.dart)
28 |
29 | ### API
30 |
31 | | Attribute | Description | Type | Default |
32 | | ------------ | ------------ | ------------ | ------------ |
33 | | finished | Whether loading is finished,the `onLoad` event will not be triggered when finished | `bool` | `false` |
34 | | error | Whether loading is error,the `onLoad` event will be triggered only when error text clicked | `bool` | `false` |
35 | | offset | The `onLoad` event will be triggered when the distance between the scrollbar and the bottom is less than `offset` | `int` | `30` |
36 | | loadingText | Loading text | `String` | `加载中...` |
37 | | finishedText | Finished text | `String` | - |
38 | | errorText | Error loaded text | `String` | - |
39 | | child | List content | `List` | - |
40 | | onLoad | Triggered when the distance between the scrollbar and the bottom is less than `offset` | `Function()` | - |
41 |
--------------------------------------------------------------------------------
/doc/en/loading.md:
--------------------------------------------------------------------------------
1 | ## Loading
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Loading(
9 | color: Colors.blueAccent,
10 | ...
11 | )
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoLoading.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | text | Loading description | `String` | - |
21 | | color | Loading ring color | `Color` | `#c9c9c9` |
22 | | size | Loading ring size | `double` | `30.0` |
23 | | textSize | Loading description font size | `double` | `14.0` |
24 | | vertical | Whether to arrange icons and text content vertically | `bool` | `false` |
25 | | loading | Custom Content | `Widget` | - |
26 |
--------------------------------------------------------------------------------
/doc/en/noticeBar.md:
--------------------------------------------------------------------------------
1 | ## NoticeBar
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NoticeBar(
9 | text: "XXXX",
10 | ...
11 | ),
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoNoticeBar.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | color | Text color | `Color` | `#fffbe8` |
21 | | background | Background | `Color` | `#ed6a0c` |
22 | | text | Content | `String` | - |
23 | | leftIcon | Left icon | `IconData` | - |
24 | | mode | Mode, can be set to `closeable`` link` | `String` | - |
25 | | scrollable | Whether to scroll content | `bool` | `true` |
26 | | wrapable | Whether to enable text wrap | `bool` | `true` |
27 | | speed | scroll speed | `int` | `5` |
28 | | delay | Animation delay(s) | `int` | `100` |
29 | | onClose | Triggered when closed | `Function()` | - |
30 | | onClick | Triggered when click notice bar | `Function()` | - |
31 |
--------------------------------------------------------------------------------
/doc/en/numberKeyboard.md:
--------------------------------------------------------------------------------
1 | ## NumberKeyboard
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NumberKeyboard(
9 | title: "Default Number Keyboard",
10 | closeButtomText: "Submit",
11 | ...
12 | ).show(context);
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoNumberKeyboard.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | value | Current value | `String` | - |
22 | | title | Keyboard Title | `String` | - |
23 | | maxlength | Value maxlength | `int` | - |
24 | | extraKey | Content of bottom left key | `String` | - |
25 | | closeButtomText | Close button text | `String` | - |
26 | | deleteButtonText | Delete button text | `String` | `delete` |
27 | | showDeleteKey | Whether to show the delete button | `bool` | `true` |
28 | | onChange | Triggered when the current input value changes | `Function(String val)` | - |
29 | | onSubmitted | Triggered when the current value's length is equal to the maxlength | `Function(String val)` | - |
30 | | onClose | Triggered when the keyboard is closed | `Function()` | - |
31 |
--------------------------------------------------------------------------------
/doc/en/pagination.md:
--------------------------------------------------------------------------------
1 | ## Pagination
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Pagination(
9 | totalItems: 36,
10 | ...
11 | )
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPagination.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | current | Current page | `int` | `1` |
21 | | totalItems | Total items | `int` | `0` |
22 | | itemsPerPage | items per page | `int` | `10` |
23 | | mode | Display mode, can be set to `simple` | `String` | `multi` |
24 | | prevText | Previous Text | `String` | `Previous` |
25 | | nextText | Next Text | `String` | `Next`
26 | | showPageSize | Number of page numbers displayed | `int` | `5` |
27 | | onChange | Triggered when the page number changes | `Function(int page)` | - |
28 |
--------------------------------------------------------------------------------
/doc/en/panel.md:
--------------------------------------------------------------------------------
1 | ## Panel
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Panel(
9 | title: "Title",
10 | desc: "Description",
11 | ...
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPanel.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | title | Title | `String` | - |
22 | | desc | Description | `String` | - |
23 | | status | Status | `String` | - |
24 | | body | Custom content | `Widget` | - |
25 | | footer | Custom footer | `Widget` | - |
26 |
--------------------------------------------------------------------------------
/doc/en/passwordInput.md:
--------------------------------------------------------------------------------
1 | ## PasswordInput
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | PasswordInput(
9 | value: _value,
10 | info: "Password is 6 digits",
11 | ...
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPasswordInput.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | value | Password value | `String` | - |
22 | | length | maximum password length | `int` | `6` |
23 | | mask | Whether to hide the password content | `bool` | `true` |
24 | | hideWhenSubmitted | Whether to automatically hide the keyboard when the current value's length is equal to the maxlength | `bool` | `false` |
25 | | info | Bottom info | `String` | - |
26 | | onClick | Triggered when input box is clicked | `Function()` | - |
27 | | onChange | Triggered when the password value changes | `Function(String val)` | - |
28 | | onSubmitted | Triggered when the current value's length is equal to the maxlength | `Function(String val)` | - |
29 |
--------------------------------------------------------------------------------
/doc/en/picker.md:
--------------------------------------------------------------------------------
1 | ## Picker
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Picker(
9 | colums: options
10 | ...
11 | ),
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPicker.dart)
15 |
16 | ### API
17 |
18 | #### Picker
19 |
20 | | Attribute | Description | Type | Default |
21 | | ------------ | ------------ | ------------ | ------------ |
22 | | colums | Columns data | `List` | - |
23 | | showToolbar | Whether to show toolbar | `bool` | `false` |
24 | | toolbarPosition | Toolbar position, cat be set to `bottom` | `String` | `top` |
25 | | title | Top Bar Title | `String` | - |
26 | | loading | whether to show loading status | `bool` | `false` |
27 | | itemHeight | Option height | `double` | `44.0` |
28 | | confirmButtonText | Confirm Button Text | `String` | `Confirm` |
29 | | cancelButtonText | Cancel Button Text | `String` | `Cancel` |
30 | | defaultIndex | Default value index of the picker | `int || List` | `0 || [0]` |
31 | | level | Number of columns for multi-column picker | `int` | `1` |
32 | | onCancel | Triggered when click cancel button | `Function(List selectedValues, dynamic selectedIndex)` | - |
33 | | onConfirm | Triggered when click confirm button | `Function(List selectedValues, dynamic selectedIndex)` | - |
34 | | onChange | triggered when current option is changed | `Function(List selectedValues, dynamic selectedIndex)` | - |
35 |
36 | #### PickerItem
37 |
38 | | Attribute | Description | Type | Default |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | text | Picker Item Text | `String` | - |
41 | | child | Picker Item Columns | `List` | - |
42 |
--------------------------------------------------------------------------------
/doc/en/price.md:
--------------------------------------------------------------------------------
1 | ## Price
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Price(
9 | value: 1234.567,
10 | )
11 | ```
12 |
13 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPrice.dart)
14 |
15 | ### API
16 |
17 | | Attribute | Description | Type | Default |
18 | | ------------ | ------------ | ------------ | ------------ |
19 | | value | Price | `double` | - |
20 | | color | Price color | `Color` | `#323233` |
21 | | size | Price size | `double` | `20` |
22 | | currency | Currency symbol | `String` | `¥` |
23 | | decimal | Decimal point | `int` | `2` |
24 | | thousands | Whether to display as thousands signs | `bool` | `false` |
25 |
--------------------------------------------------------------------------------
/doc/en/progress.md:
--------------------------------------------------------------------------------
1 | ## Progress
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Progress(
9 | percentage: 50,
10 | showPivot: true
11 | ...
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoProgress.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | inactive | Inactive | `bool` | `false` |
22 | | percentage | Progress percentage | `double` | `0` |
23 | | strokeWidth | Stroke width | `double` | `5` |
24 | | showPivot | Whether to show pivot | `bool` | `false` |
25 | | color | Progress color | `Color` | `#1989fa` |
26 | | textColor | Progress text color | `Color` | `#ffffff` |
27 | | trackColor | Track color | `Color` | `#ebedf0` |
28 | | pivotText | Pivot text | `String` | - |
29 | | pivotColor | Pivot color | `Color` | - |
30 |
--------------------------------------------------------------------------------
/doc/en/radio.md:
--------------------------------------------------------------------------------
1 | ## Radio
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | RadioItem(name: "a", text: "Radio A"),
10 | RadioItem(name: "b", text: "Radio B"),
11 | ];
12 |
13 | RadioGroup(
14 | value: 'a',
15 | list: list,
16 | ...
17 | )
18 | ```
19 |
20 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoRadio.dart)
21 |
22 | ### API
23 |
24 | #### RadioGroup
25 |
26 | | Attribute | Description | Type | Default |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | list | Options | `List` | - |
29 | | value | The identifier of the selected item | `String` | - |
30 | | shape | The shape of all options | `String` | `round` |
31 | | inCellGroup | Whether it is a cell component | `bool` | `false` |
32 | | disabled | Whether to disable all radio boxes | `bool` | `false` |
33 | | iconSize | Icon size for all radio boxes | `double` | |
34 | | checkedColor | Checked state color of all radio boxes | `Color` | - |
35 | | onChange | Triggered when the binding value changes | `Function(String val)` | - |
36 |
37 | #### RadioItem
38 |
39 | | Attribute | Description | Type | Default |
40 | | ------------ | ------------ | ------------ | ------------ |
41 | | name | Radio Name | `String` | - |
42 | | value | Check status | `bool` | `false` |
43 | | shape | The shape of the option, can be set to `square` | `String` | `round` |
44 | | text | Option description | `String` | - |
45 | | disabled | Disable the radio box | `bool` | `false` |
46 | | iconSize | Icon size | `double` | `20` |
47 | | checkedColor | Checked color | `Color` | `#1989fa` |
48 |
--------------------------------------------------------------------------------
/doc/en/rate.md:
--------------------------------------------------------------------------------
1 | ## Rate
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Rate(
9 | icon: Icons.favorite,
10 | ...
11 | )
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoRate.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | count | Count | `int` | `5` |
21 | | value | Current rate | `int` | - |
22 | | size | Icon size | `double` | `24.0` |
23 | | gutter | Icon spacing | `double` | `4.0` |
24 | | icon | Custom icon | `IconData` | `star` |
25 | | voidIcon | Custom unselected icon | `IconData` | `star_border` |
26 | | color | Selected color | `Color` | `#ffd21e` |
27 | | voidColor | Unselected color | `Color` | `#dcdee0` |
28 | | readonly | Whether it is read-only | `bool` | `false` |
29 | | disabled | whether it is disabled | `bool` | `false` |
30 | | onChange | Triggered when the current rate changes | `Function(String val)` | - |
31 |
--------------------------------------------------------------------------------
/doc/en/search.md:
--------------------------------------------------------------------------------
1 | ## Search
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Search(
9 | showAction: true,
10 | ...
11 | )
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSearch.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | shape | Shape of field, can be set to `round` | `String` | `square` |
21 | | background | Background color of field | `Color` | `#f7f8fA` |
22 | | maxLength | Max length of value | `int` | `100` |
23 | | placeholder | Placeholder | `String` | `Please enter search keywords` |
24 | | clearable | Whether to be clearable | `bool` | `true` |
25 | | showAction | Whether to show right action button | `bool` | `false` |
26 | | actionText | Cancel Button Text | `String` | `Cancel` |
27 | | disabled | Whether to disable field | `bool` | `false` |
28 | | readonly | Whether to be readonly | `bool` | `false` |
29 | | leftIcon | Left icon | `IconData` | `search` |
30 | | rightIcon | Right icon | `IconData` | - |
31 | | left | Custom left content | `Widget` | - |
32 | | right | Custom right content | `Widget` | - |
33 | | onClickLeft | Triggered when click on the left | `Function()` | - |
34 | | onClickRight | Triggered when click on the right | `Function()` | - |
35 | | onSubmitted | Triggered when click the submit button | `Function(String val)` | - |
36 | | OnCancel | Triggered when click the cancel button | `Function()` | - |
37 |
--------------------------------------------------------------------------------
/doc/en/shareSheet.md:
--------------------------------------------------------------------------------
1 | ## ShareSheet
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List options = [
9 | ShareSheetItem(name: "WeChat"),
10 | ...
11 | ];
12 |
13 | ShareSheet(
14 | title: "Share Friends",
15 | options: options
16 | ...
17 | ).show(context);
18 | ```
19 |
20 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoShareSheet.dart)
21 |
22 | ### API
23 |
24 | #### ShareSheetItem
25 |
26 | | Attribute | Description | Type | Default |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | name | Option name | `String` | - |
29 | | description | Option description | `String` | - |
30 | | icon | Option icon | `Widget` | - |
31 |
32 | #### ShareSheet
33 |
34 | | Attribute | Description | Type | Default |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | options | Share options | `List` | - |
37 | | title | Title | `String` | - |
38 | | cancelText | Cancel button text | `String` | - |
39 | | description | Description | `String` | - |
40 | | closeOnClickOverlay | Whether to close when overlay is clicked | `bool` | `true` |
41 | | wrap | Whether to display in multiple lines | `bool` | `false` |
42 | | wrapNumber | the display number of each line, when `wrap=true` | `int` | `4` |
43 | | onSelect | Emitted when an option is clicked | `Function(ShareSheetItem shareSheetItem, int index)` | - |
44 | | onCancel | Emitted when the cancel button is clicked | `Function()` | - |
45 |
--------------------------------------------------------------------------------
/doc/en/sidebar.md:
--------------------------------------------------------------------------------
1 | ## Sidebar
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | SideBarItem(
10 | title: "Title"
11 | ),
12 | SideBarItem(
13 | title: "Title"
14 | ),
15 | ...
16 | ];
17 |
18 | Sidebar(
19 | list: list,
20 | ...
21 | )
22 | ```
23 |
24 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSidebar.dart)
25 |
26 | ### API
27 |
28 | #### Sidebar
29 |
30 | | Attribute | Description | Type | Default |
31 | | ------------ | ------------ | ------------ | ------------ |
32 | | active | Current option | `int` | `0` |
33 | | list | All options | `List` | - |
34 | | onChange | Triggered when the current option changes | `Function(int val)` | - |
35 |
36 | #### SideBarItem
37 |
38 | | Attribute | Description | Type | Default |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | title | Content | `String` | - |
41 | | dot | Whether to show red dot | `bool` | `false` |
42 | | info | Content of the badge | `String` | - |
43 | | disabled | Whether to be disabled | `bool` | `false` |
44 | | onClick | Triggered when click on the option | `Function(int val)` | - |
45 | | children | Sub-option content | `List` | - |
46 | | content | Custom sub-option content | `Widget` | - |
47 |
--------------------------------------------------------------------------------
/doc/en/skeleton.md:
--------------------------------------------------------------------------------
1 | ## Skeleton
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Skeleton(
9 | row: 3,
10 | title: true,
11 | ...
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSkeleton.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | row | Row count | `int` | `0` |
22 | | rowWidth | pRow width | `double` | `1` |
23 | | title | Whether to show title placeholder | `bool` | `false` |
24 | | titleWidth | Title width | `double` | `.4` |
25 | | avatar | Whether to show avatar placeholder | `bool` | `false` |
26 | | avatarSize | Size of avatar placeholder | `double` | `36` |
27 | | avatarShape | Shape of avatar placeholder,can be set to `round` | `String` | `suqare` |
28 | | loading | Whether to show skeleton | `bool` | `false` |
29 | | child | display content when skeleton displayed | `Widget` | - |
30 |
--------------------------------------------------------------------------------
/doc/en/stepper.md:
--------------------------------------------------------------------------------
1 | ## Stepper
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Steppers(
9 | step: 2,
10 | ...
11 | )
12 | ```
13 |
14 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoStepper.dart)
15 |
16 | ### API
17 |
18 | | Attribute | Description | Type | Default |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | value | Current value | `double` | - |
21 | | min | Min value | `double` | `0` |
22 | | max | Max value | `double` | - |
23 | | step | Value change step | `double` | `1` |
24 | | disabled | Whether to disable value change | `bool` | `false` |
25 | | disabledInput | Whether to disable the field | `bool` | `false` |
26 | | size | Custom size | `double` | `20.0` |
27 | | inputWidth | Custom input width | `double` | - |
28 | | showPlus | Whether to show the add button | `bool` | `true` |
29 | | showMinus | whether to show the decrease button | `bool` | `true` |
30 | | decimalLength | Decimal length | `int` | `0` |
31 | | onChange | Triggered when the current value changes | `Function(String val)` | - |
32 |
--------------------------------------------------------------------------------
/doc/en/steps.md:
--------------------------------------------------------------------------------
1 | ## Steps
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List steps = [
9 | StepItem ("Buyer Order"),
10 | StepItem ("Merchant Order"),
11 | StepItem ("Buyer Pickup"),
12 | StepItem ("Transaction completed"),
13 | ];
14 |
15 | Steps(
16 | steps: steps,
17 | active: _active
18 | ),
19 | ```
20 |
21 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSteps.dart)
22 |
23 | ### API
24 |
25 | #### Steps
26 |
27 | | Attribute | Description | Type | Default |
28 | | ------------ | ------------ | ------------ | ------------ |
29 | | steps | All steps | `List ` | - |
30 | | active | Active step | `int` | `0` |
31 | | direction | Can be set to `vertical` | `String` | `horizontal` |
32 | | activeColor | Active step color | `Color` | `#07c160` |
33 | | activeIcon | Active icon | `IconData` | `check_circle` |
34 | | inactiveIcon | Inactive icon | `IconData` | - |
35 |
36 | #### StepItem
37 |
38 | | Attribute | Description | Type | Default |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | title | Step description | `String` | - |
41 | | date | Step date | `String` | - |
42 |
--------------------------------------------------------------------------------
/doc/en/submitBar.md:
--------------------------------------------------------------------------------
1 | ## SubmitBar
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | SubmitBar(
9 | buttonText: "Submit",
10 | price: 30.50,
11 | ...
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSubmitBar.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | price | Price | `double` | - |
22 | | label | Price left label | `String` | `Total:` |
23 | | suffixLabel | Price right label | `String` | - |
24 | | textAlign | Price label text align can be set to `left` | `String` | `right` |
25 | | buttonText | Button text | `String` | - |
26 | | tip | Tip | `String` | - |
27 | | tipIcon | Icon | `IconData` | - |
28 | | disabled | Whether to disable button | `bool` | `false` |
29 | | loading | Whether to show loading icon | `bool` | `false` |
30 | | currency | Currency symbol | `String` | `¥` |
31 | | decimalLength | Number of digits to appear after the decimal point | `int` | `2` |
32 | | onSubmit | Triggerd when click submit button | `Function ()` | - |
33 | | customTip | Custom tips | `Widget` | - |
34 | | customTop | Custom top content | `Widget` | - |
35 | | customLeft | Custom left content | `Widget` | - |
36 |
--------------------------------------------------------------------------------
/doc/en/swipe.md:
--------------------------------------------------------------------------------
1 | ## Swipe
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List images = [
9 | Image.network("https://img.yzcdn.cn/vant/apple-1.jpg"),
10 | Image.network("https://img.yzcdn.cn/vant/apple-2.jpg"),
11 | Image.network("https://img.yzcdn.cn/vant/apple-3.jpg"),
12 | Image.network("https://img.yzcdn.cn/vant/apple-4.jpg")
13 | ];
14 |
15 | Swipe(
16 | autoPlay: true,
17 | children: images,
18 | ...
19 | )
20 | ```
21 |
22 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSwipe.dart)
23 |
24 | ### API
25 |
26 | | Attribute | Description | Type | Default |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | autoPlay | Whether to play automatically | `bool` | `false` |
29 | | interval | Auto Carousel Interval | `Duration` | `Duration(seconds: 3)` |
30 | | duration | Animation duration | `Duration` | `Duration(seconds: 1)` |
31 | | initialSwipe | Initial position index | `int` | `0` |
32 | | showIndicators | Whether to show indicators | `bool` | `true` |
33 | | indicatorSize | Indicator size | `double` | `8.0` |
34 | | indicatorColor | Indicator color | `Color` | `# 1989fa` |
35 | | scrollDirection | Scroll direction, can be set to `vertical` | `String` | `horizontal` |
36 | | curve | Animation | `Curve` | `fastOutSlowIn` |
37 | | onChange | Triggered after each page carousel | `Function(int val)` | - |
38 | | viewportFraction | Proportion of the window occupied by each page in the scroll direction | `double` | `1.0` |
39 | | children | Display content | `List` | - |
40 | | indicator | Custom indicator | `Widget` | - |
41 |
--------------------------------------------------------------------------------
/doc/en/tag.md:
--------------------------------------------------------------------------------
1 | ## Tag
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Tag(
9 | type: "primary"
10 | text: "Label",
11 | 。。。
12 | )
13 | ```
14 |
15 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoTag.dart)
16 |
17 | ### API
18 |
19 | | Attribute | Description | Type | Default |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | type | Type, can be set to `primary`` success` `danger`` warning` | `String` | `default` |
22 | | size | Size, can be set to `large`` medium` | `String` | `default` |
23 | | text | Text in tags | `String` | - |
24 | | plain | Whether to be plain style | `bool` | `false` |
25 | | round | Whether to be round style | `bool` | `false` |
26 | | mark | Whether to be mark style | `bool` | `false` |
27 | | color | Color | `Color` | `# 1989fa` |
28 | | textColor | Text color | `Color` | - |
29 | | onClose | Whether to be closeable | `Function()` | - |
30 |
--------------------------------------------------------------------------------
/doc/en/treeSelect.md:
--------------------------------------------------------------------------------
1 | ## TreeSelect
2 |
3 | ### Example
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | SideBarItem(
10 | title: "Zhe Jiang",
11 | children: [
12 | TreeItem(text: "Han Zhou", id: 1),
13 | TreeItem(text: "Wen Zhou", id: 2),
14 | TreeItem(text: "Ning Bo", id: 3, disabled: true),
15 | TreeItem(text: "Yi Wu", id: 4),
16 | ]
17 | ),
18 | ...
19 | ];
20 |
21 | TreeSelect(
22 | activeId: [1],
23 | list: list,
24 | )
25 | ```
26 |
27 | More examples please refer [Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoTreeSelect.dart)
28 |
29 | ### API
30 |
31 | #### TreeSelect
32 |
33 | | Attribute | Description | Type | Default |
34 | | ------------ | ------------ | ------------ | ------------ |
35 | | list | All options | `List` | - |
36 | | mainActiveIndex | The index of selected parent node | `int` | `0` |
37 | | activeId | Id of selected item | `List` | - |
38 | | height | Height | `double` | `300.0` |
39 | | max | Maximum number of selected items | `int` | `1` |
40 | | onChange | Triggered when the selected value on the left changes | `Function(List list)` | - |
41 |
42 | #### TreeItem
43 |
44 | | Attribute | Description | Type | Default |
45 | | ------------ | ------------ | ------------ | ------------ |
46 | | text | Right option name | `String` | - |
47 | | id | Right option id | `int` | - |
48 | | disabled | Whether to disable the item | `bool` | `false` |
49 |
--------------------------------------------------------------------------------
/doc/zh/actionSheet.md:
--------------------------------------------------------------------------------
1 | ## ActionSheet 上拉菜单
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List actionList = [
9 | ActionSheetItem(name: "选项"),
10 | ...
11 | ];
12 |
13 | ActionSheet(
14 | actions: actionList
15 | ).show(context);
16 | ```
17 |
18 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoActionSheet.dart)
19 |
20 | ### API
21 |
22 | #### ActionSheetItem
23 |
24 | | 参数 | 说明 | 类型 | 默认值 |
25 | | ------------ | ------------ | ------------ | ------------ |
26 | | name | 标题 | `String` | - |
27 | | subname | 二级标题 | `String` | - |
28 | | color | 选项文字颜色 | `Color` | `#323233` |
29 | | loading | 是否为加载状态 | `bool` | `false` |
30 | | disabled | 是否为禁用状态 | `bool` | `false` |
31 |
32 | #### ActionSheet
33 |
34 | | 参数 | 说明 | 类型 | 默认值 |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | actions | 菜单选项 | `List` | - |
37 | | title | 顶部标题 | `String` | - |
38 | | cancelText | 取消按钮文字 | `String` | - |
39 | | description | 选项上方的描述信息 | `String` | - |
40 | | round | 是否显示圆角 | `bool` | `true` |
41 | | closeIcon | 关闭图标 | `IconData` | - |
42 | | closeOnClickOverlay | 是否在点击遮罩层后关闭 | `bool` | `true` |
43 | | onSelect | 选中选项时触发,禁用或加载状态下不会触发 | `Function(ActionSheetItem actionSheetItem, int index, BuildContext context)` | - |
44 | | onCancel | 取消按钮点击时触发 | `Function()` | - |
45 | | onClose | 关闭菜单时触发 | `Function()` | - |
46 | | child | 自定义菜单内容 | `Widget` | - |
47 |
--------------------------------------------------------------------------------
/doc/zh/addressEdit.md:
--------------------------------------------------------------------------------
1 | ## AddressEdit 地址编辑
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | AddressEdit(
9 | showDelete: true,
10 | showSetDefault: true,
11 | addressInfo: {
12 | "name": "张三",
13 | "tel": "18345234123",
14 | "province": "广东省",
15 | "city": "深圳市",
16 | "county": "南山区",
17 | "provinceId": 0,
18 | "cityId": 1,
19 | "countyId": 0,
20 | "addressDetail": "明珠花园",
21 | "postalCode": "515000",
22 | "isDefault": true
23 | },
24 | ...
25 | )
26 | ```
27 |
28 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoAddressEdit.dart)
29 |
30 | ### API
31 |
32 | #### AddressEdit
33 |
34 | | 参数 | 说明 | 类型 | 默认值 |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | areaColumnsPlaceholder | 地区选择列占位提示文字 | `String` | `选择省 / 市 / 区` |
37 | | addressInfo | 收货人信息初始值 | `Map` | - |
38 | | showPostal | 是否显示邮政编码 | `bool` | `true` |
39 | | showDelete | 是否显示删除按钮 | `bool` | `false` |
40 | | showSetDefault | 是否显示默认地址栏 | `bool` | `false` |
41 | | saveButtonText | 保存按钮文字 | `String` | `保存` |
42 | | deleteButtonText | 删除按钮文字 | `String` | `删除` |
43 | | detailRows | 详细地址输入框行数 | `int` | `1` |
44 | | detailMaxlength | 详细地址最大长度 | `int` | `200` |
45 | | children | 自定义内容 | `List` | - |
46 | | onSave | 点击保存按钮时触发 | `Function(Map map)` | - |
47 | | onDelete | 确认删除地址时触发 | `Function(Map map)` | - |
48 | | onCancelDelete | 取消删除地址时触发 | `Function(Map map)` | - |
49 |
50 | #### AddressInfo
51 |
52 | | 参数 | 说明 | 类型 |
53 | | ------------ | ------------ | ------------ |
54 | | name | 姓名 | `String` |
55 | | tel | 手机号码 | `String` |
56 | | province | 省份 | `String` |
57 | | city | 城市名 | `String` |
58 | | county | 区名 | `String` |
59 | | provinceId | 省份ID | `int` |
60 | | cityId | 城市ID | `int` |
61 | | countyId | 城区ID | `int` |
62 | | addressDetail | 详细地址 | `String` |
63 | | postalCode | 邮政编号 | `String` |
64 | | isDefault | 是否为默认地址 | `bool` |
65 |
--------------------------------------------------------------------------------
/doc/zh/addressList.md:
--------------------------------------------------------------------------------
1 | ## AddressList 地址列表
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | AddressInfo(
10 | name: "张三",
11 | tel: "18345234123",
12 | province: "广东省",
13 | city: "深圳市",
14 | county: "南山区",
15 | "provinceId": 0,
16 | "cityId": 1,
17 | "countyId": 0,
18 | addressDetail: "明珠花园",
19 | postalCode: "515000",
20 | isDefault: true
21 | )
22 | ]
23 |
24 | AddressList(
25 | id: 0,
26 | list: list,
27 | disabledList: disabledList,
28 | ...
29 | )
30 | ```
31 |
32 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoAddressList.dart)
33 |
34 | ### API
35 |
36 | #### AddressList
37 |
38 | | 参数 | 说明 | 类型 | 默认值 |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | id | 当前选中地址的 id | `int` | - |
41 | | list | 地址列表 | `List` | - |
42 | | disabledList | 不可配送地址列表 | `List` | - |
43 | | disabledText | 不可配送提示文案 | `String` | `以下地址超出配送范围` |
44 | | switchable | 是否允许切换地址 | `bool` | `true` |
45 | | addButtonText | 底部按钮文字 | `String` | `新增地址` |
46 | | defaultTagText | 默认地址标签文字 | `String` | `默认` |
47 | | onAdd | 点击新增按钮时触发 | `Function()` | - |
48 | | onEdit | 点击编辑按钮时触发 | `Function(AddressInfo info, int i)` | - |
49 | | onSelect | 切换选中的地址时触发 | `Function(AddressInfo info, int i)` | - |
50 | | top | 在顶部插入内容 | `Widget` | - |
51 | | children | 在列表下方插入内容 | `Widget` | - |
52 |
53 | #### AddressInfo
54 |
55 | | 参数 | 说明 | 类型 |
56 | | ------------ | ------------ | ------------ |
57 | | name | 姓名 | `String` |
58 | | tel | 手机号码 | `String` |
59 | | province | 省份 | `String` |
60 | | city | 城市名 | `String` |
61 | | county | 区名 | `String` |
62 | | provinceId | 省份ID | `int` |
63 | | cityId | 城市ID | `int` |
64 | | countyId | 城区ID | `int` |
65 | | addressDetail | 详细地址 | `String` |
66 | | postalCode | 邮政编号 | `String` |
67 | | is默认值 | 是否为默认地址 | `bool` |
68 |
--------------------------------------------------------------------------------
/doc/zh/avatar.md:
--------------------------------------------------------------------------------
1 | ## Avatar 头像
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Avatar(
9 | type: 'large'
10 | ...
11 | )
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoAvatar.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | type | 头像类型,可选值为`large` `small` | `String` | `normal` |
21 | | size | 头像大小,优先级比`type`的尺寸高 | `double` | - |
22 | | shape | 头像形状,可选值为`square` | `String` | `round` |
23 | | color | 头像背景颜色 | `Color` | `#ebedf0` |
24 | | iconColor | 头像图标颜色 | `Color` | `#323233` |
25 | | custom | 自定义图标内容 | `Widget` | - |
26 | | image | 头像图片内容 | `ImageProvider` | - |
27 | | onClick | 点击头像后回调 | `Function()` | - |
28 |
--------------------------------------------------------------------------------
/doc/zh/badge.md:
--------------------------------------------------------------------------------
1 | ## Badge 徽标
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Badge(
9 | value: "10",
10 | child: ...,
11 | ),
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoBadge.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | value | 角标内容 | `String` | - |
21 | | dot | 红点 | `bool` | `false` |
22 | | max | 最大值,超过最大值会显示`{max}+`,仅当 value 为数字时有效 | `int` | - |
23 | | color | 自定义颜色 | `Color` | `#ee0a24` |
24 | | textColor | 自定义文本颜色 | `Color` | `#ffffff` |
25 | | textSize | 自定义文本大小 | `double` | `12.0` |
26 | | child | 自定义徽标 | `Widget` | - |
27 | | content | 自定义徽标内容 | `Widget` | - |
28 |
--------------------------------------------------------------------------------
/doc/zh/button.md:
--------------------------------------------------------------------------------
1 | ## Button 按钮
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NButton(
9 | text: "按钮",
10 | type: "primary",
11 | ...
12 | ),
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoButton.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | type | 类型,可选值为`primary` `info` `danger` `warning` | `String` | `default` |
22 | | size | 尺寸,可选值为`large` `small` `mini` | `String` | `normal` |
23 | | text | 按钮文字 | `String` | - |
24 | | width | 按钮宽度 | `double` | - |
25 | | height | 按钮高度,优先级比`size`的高度高 | `double` | - |
26 | | color | 按钮颜色,优先级比`type`的颜色高,支持渐变色设置,`LinearGradient` `RadialGradient`等 | `Color || Gradient` | - |
27 | | icon | 左侧图标 | `Icon` | - |
28 | | textColor | 按钮文字颜色,优先级比`type`的颜色高 | `Color` | - |
29 | | block | 是否为块级元素 | `bool` | `false` |
30 | | plain | 是否为朴素按钮 | `bool` | `false` |
31 | | square | 是否为方形按钮 | `bool` | `false` |
32 | | round | 是否为圆形按钮 | `bool` | `false` |
33 | | disabled | 是否禁用按钮 | `bool` | `false` |
34 | | loading | 是否为加载中 | `bool` | `false` |
35 | | hairline | 是否使用 0.5px 边框 | `bool` | `false` |
36 | | padding | 自定义内边距,优先级比`size`的内边距高 | `EdgeInsets` | - |
37 | | borderRadius | 自定义按钮圆角,优先级比`size`的圆角高 | `BorderRadius` | - |
38 | | onClick | 点击按钮后回调 | `Function()` | - |
39 |
--------------------------------------------------------------------------------
/doc/zh/calendar.md:
--------------------------------------------------------------------------------
1 | ## Calendar 日历
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | DateTime selectedDate;
9 |
10 | Calendar(
11 | defaultDate: selectedDate,
12 | ...
13 | ).show(context);
14 | ```
15 |
16 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCalendar.dart)
17 |
18 | ### API
19 |
20 | | 参数 | 说明 | 类型 | 默认值 |
21 | | ------------ | ------------ | ------------ | ------------ |
22 | | type | 选择类型,`single`表示选择单个日期,`range`表示选择日期区间 | `String` | `single` |
23 | | title | 日历标题 | `String` | `日期选择` |
24 | | color | 颜色,对底部按钮和选中日期生效 | `Color` | `#1989fa` |
25 | | minDate | 最小日期 | `DateTime` | - |
26 | | maxDate | 最大日期 | `DateTime` | - |
27 | | defaultDate | 默认选中的日期 | `DateTime` | - |
28 | | rowHeight | 日期行高 | `double` | - |
29 | | poppable | 是否以弹层的形式展示日历 | `bool` | `true` |
30 | | round | 是否显示圆角弹窗 | `bool` | `true` |
31 | | showMark | 是否显示月份背景水印 | `bool` | `true` |
32 | | showConfirm | 是否展示确认按钮 | `bool` | `true` |
33 | | closeOnClickOverlay | 是否在点击遮罩层后关闭 | `bool` | `true` |
34 | | confirmText | 确认按钮的文字 | `String` | `确定` |
35 | | height | 日程高度,当 `poppable=false` 时生效 | `double` | `400.0` |
36 | | onSelect | 点击任意日期时触发 | `Function(DateTime date)` | - |
37 | | onConfirm | 日期选择完成后触发,若`showConfirm=true`,则点击确认按钮后触发 | `Function(DateTime date)` | - |
38 |
--------------------------------------------------------------------------------
/doc/zh/card.md:
--------------------------------------------------------------------------------
1 | ## Card 商品卡片
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NCard(
9 | title: "商品名称",
10 | desc: "描述信息",
11 | ...
12 | ),
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCard.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | image | 左侧图片 | `Image` | - |
22 | | title | 标题 | `String` | - |
23 | | desc | 描述 | `String` | - |
24 | | tag | 图片角标 | `String` | - |
25 | | num | 商品数量 | `int` | - |
26 | | price | 商品价格 | `double` | - |
27 | | originPrice | 商品划线原价 | `double` | - |
28 | | centered | 内容是否垂直居中 | `bool` | `false` |
29 | | currency | 货币符号 | `String` | `¥` |
30 | | onClick | 点击时触发 | `Function()` | - |
31 | | customTitle | 自定义标题内容 | `Widget` | - |
32 | | customDesc | 自定义描述 | `Widget` | - |
33 | | customNum | 自定义数量 | `Widget` | - |
34 | | customPrice | 自定义价格 | `Widget` | - |
35 | | customOriginPrice | 自定义商品原价 | `Widget` | - |
36 | | customThumb | 自定义图片 | `Widget` | - |
37 | | customTag | 自定义图片角标 | `Widget` | - |
38 | | customTags | 自定义描述下方标签区域 | `Widget` | - |
39 | | customFooter | 自定义 footer | `Widget` | - |
40 |
--------------------------------------------------------------------------------
/doc/zh/cell.md:
--------------------------------------------------------------------------------
1 | ## Cell 单元格
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | CellGroup(
9 | children: [
10 | Cell(
11 | title: "单元格",
12 | value: "内容"
13 | ...
14 | ),
15 | ]
16 | ),
17 | ```
18 |
19 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCell.dart)
20 |
21 | ### API
22 |
23 | #### CellGroup
24 |
25 | | 参数 | 说明 | 类型 | 默认值 |
26 | | ------------ | ------------ | ------------ | ------------ |
27 | | title | 分组标题 | `String` | - |
28 | | border | 是否显示外边框 | `bool` | `true` |
29 | | decoration | 自定义边框样式 | `BoxDecoration` | - |
30 | | children | 默认插槽 | `List` | - |
31 |
32 | #### Cell
33 |
34 | | 参数 | 说明 | 类型 | 默认值 |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | title | 左侧标题 | `String` | - |
37 | | label | 标题下方的描述信息 | `String` | - |
38 | | value | 右侧内容 | `String` | - |
39 | | icon | 左侧图标 | `IconData` | - |
40 | | size | 单元格大小,可选值为`large` | `String` | `normal` |
41 | | require | 是否显示表单必填星号 | `bool` | `false` |
42 | | clickable | 是否可点击 | `bool` | `false` |
43 | | isLink | 是否展示右侧箭头并开启点击反馈 | `bool` | `false` |
44 | | arrowDirection | 箭头方向,可选值为`left` `up` `down` | `String` | `right` |
45 | | customTitle | 自定义标题内容 | `Widget` | - |
46 | | customLabel | 自定义标题下方描述 | `Widget` | - |
47 | | customRight | 自定义右侧内容 | `Widget` | - |
48 | | onClick | 点击单元格时触发 | `Function()` | - |
49 |
--------------------------------------------------------------------------------
/doc/zh/checkbox.md:
--------------------------------------------------------------------------------
1 | ## Checkbox 复选框
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | CheckItem(name: "a", text: "复选框a"),
10 | CheckItem(name: "b", text: "复选框b"),
11 | ...
12 | ];
13 |
14 | CheckboxGroup(
15 | list: list,
16 | ...
17 | )
18 | ```
19 |
20 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCheckbox.dart)
21 |
22 | ### API
23 |
24 | #### CheckGroup
25 |
26 | | 参数 | 说明 | 类型 | 默认值 |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | list | 选项 | `List` | - |
29 | | value | 所有选中项的标识符 | `List` | - |
30 | | shape | 所有选项的形状 | `String` | `round` |
31 | | max | 选项的最大可选数 | `int` | `9999` |
32 | | inCellGroup | 是否为单元格组件 | `bool` | `false` |
33 | | disabled | 是否禁用复选框 | `bool` | `false` |
34 | | iconSize | 所有复选框的图标大小 | `double` | |
35 | | checkedColor | 所有复选框的选中状态颜色 | `Color` | - |
36 | | onChange | 当绑定值变化时触发的事件 | `Function(List value)` | - |
37 |
38 | #### CheckItem
39 |
40 | | 参数 | 说明 | 类型 | 默认值 |
41 | | ------------ | ------------ | ------------ | ------------ |
42 | | name | 标识符 | `String` | - |
43 | | value | 是否选中 | `bool` | `false` |
44 | | shape | 选项的形状,可选值为`square` | `String` | `round` |
45 | | text | 选项的描述 | `String` | - |
46 | | disabled | 是否禁用复选框 | `bool` | `false` |
47 | | iconSize | 图标大小 | `double` | `20` |
48 | | checkedColor | 选中状态颜色 | `Color` | `#1989fa` |
49 |
--------------------------------------------------------------------------------
/doc/zh/circle.md:
--------------------------------------------------------------------------------
1 | ## Circle 环形进度条
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Progress(
9 | type: "circular",
10 | percentage: 30,
11 | ...
12 | ),
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCircle.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | inactive | 是否置灰 | `bool` | `false` |
22 | | percentage | 进度百分比 | `double` | `0` |
23 | | strokeWidth | 进度条粗细 | `double` | `5` |
24 | | showPivot | 是否显示进度条文字 | `bool` | `false` |
25 | | color | 进度条颜色 | `Color` | `#1989fa` |
26 | | textColor | 进度文字颜色 | `Color` | `#ffffff` |
27 | | trackColor | 轨道颜色 | `Color` | `#ebedf0` |
28 | | pivotText | 文字显示 | `String` | - |
29 | | pivotColor | 文字背景色 | `Color` | - |
30 | | circularSize | 圆形进度条大小 | `double` | `120` |
31 |
--------------------------------------------------------------------------------
/doc/zh/collapse.md:
--------------------------------------------------------------------------------
1 | ## Collapse 折叠面板
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [[
9 | CollapseItem(
10 | title: "标题1",
11 | children: [
12 | Text("代码是写出来给人看的,附带能在机器上运行"),
13 | ],
14 | ),
15 | ...
16 | ]
17 |
18 | Collapse(
19 | name: ['0']
20 | list: list,
21 | ...
22 | )
23 | ```
24 |
25 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCollapse.dart)
26 |
27 | ### API
28 |
29 | #### Collapse
30 |
31 | | 参数 | 说明 | 类型 | 默认值 |
32 | | ------------ | ------------ | ------------ | ------------ |
33 | | name | 当前展开面板的 name | `List` | - |
34 | | list | 子面板 | `List` | - |
35 | | accordion | 是否为手风琴 | `bool` | `false` |
36 | | border | 是否显示外边框 | `bool` | `true` |
37 | | onChange | 切换面板时触发 | `Function(List)` | - |
38 |
39 | #### CollapseItem
40 |
41 | | 参数 | 说明 | 类型 | 默认值 |
42 | | ------------ | ------------ | ------------ | ------------ |
43 | | name | 唯一标识符,默认为索引值 | `String` | - |
44 | | isExpanded | 是否为展开 | `bool` | `false` |
45 | | icon | 左侧图标 | `IconData` | - |
46 | | title | 标题栏左侧内容 | `String` | - |
47 | | value | 标题栏右侧内容 | `String` | - |
48 | | label | 标题栏描述信息 | `String` | - |
49 | | rightIcon | 自定义右侧图标 | `Icon` | - |
50 | | clickable | 是否可点击 | `bool` | `true` |
51 | | customTitle | 自定义标题内容 | `Widget` | - |
52 | | customLabel | 自定义标题下方描述 | `Widget` | - |
53 | | content | 面板纯文本内容 | `String` | - |
54 | | children | 自定义面板内容 | `List` | - |
55 | | onExpansionChanged | 面板展开后回调 | `Function(bool isExpand)` | - |
56 |
--------------------------------------------------------------------------------
/doc/zh/contactCard.md:
--------------------------------------------------------------------------------
1 | ## ContactCard 联系人卡片
2 |
3 | ### 使用范例
4 | ```
5 | import 'package:flutter_vant_kit/main.dart';
6 |
7 | ContactCard(
8 | type: 'add'
9 | ...
10 | )
11 | ```
12 |
13 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoContactCard.dart)
14 |
15 | ### API
16 |
17 | | 参数 | 说明 | 类型 | 默认值 |
18 | | ------------ | ------------ | ------------ | ------------ |
19 | | type | 卡片类型,可选值为`edit` | `String` | `add` |
20 | | name | 联系人姓名 | `String` | - |
21 | | tel | 联系人手机号 | `String` | - |
22 | | editAble | 是否可编辑,当`type=edit`生效 | `bool` | `true` |
23 | | onClick | 点击时触发 | `Function()` | - |
24 |
--------------------------------------------------------------------------------
/doc/zh/coupon.md:
--------------------------------------------------------------------------------
1 | ## Coupon 优惠券选择器
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List coupons = [
9 | CouponItem(
10 | condition: '无使用门槛\n最多优惠12元',
11 | description: '描述信息',
12 | ...
13 | )
14 | ]
15 |
16 | Coupon(
17 | chosenCoupon: _chosenCoupon,
18 | coupons: coupons,
19 | disabledCoupons: coupons.sublist(0, 2),
20 | ...
21 | ).show(context);
22 | ```
23 |
24 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoCoupon.dart)
25 |
26 | ### API
27 |
28 | #### Coupon
29 |
30 | | 参数 | 说明 | 类型 | 默认值 |
31 | | ------------ | ------------ | ------------ | ------------ |
32 | | chosenCoupon | 当前选中优惠券的索引 | `int` | - |
33 | | coupons | 可用优惠券列表 | `List` | - |
34 | | disabledCoupons | 不可用优惠券列表 | `List` | - |
35 | | enabledTitle | 可用优惠券列表标题 | `String` | `可使用优惠券` |
36 | | disabledTitle | 不可用优惠券列表标题 | `String` | `不可使用优惠券` |
37 | | exchangeButtonText | 兑换按钮文字 | `String` | `兑换` |
38 | | exchangeButtonDisabled | 是否禁用兑换按钮 | `bool` | `false` |
39 | | exchangeMaxLength | 兑换码最大长度 | `int` | `10` |
40 | | displayedCouponIndex | 滚动至特定优惠券位置 | `int` | - |
41 | | showCloseButton | 是否显示列表底部按钮 | `bool` | `true` |
42 | | closeButtonText | 列表底部按钮文字 | `String` | `不使用优惠` |
43 | | inputPlaceholder | 输入框文字提示 | `String` | `请输入优惠码` |
44 | | showExchangeBar | 是否展示兑换栏 | `bool` | `true` |
45 | | emptyImage | 列表为空时的占位图 | `Image` | `https://img.yzcdn.cn/vant/coupon-empty.png` |
46 | | onSelect | 优惠券切换回调 | `Function(int val)` | - |
47 | | onExchange | 兑换优惠券回调 | `Function(String val)` | - |
48 |
49 | #### CouponItem
50 |
51 | | 参数 | 说明 | 类型 | 默认值 |
52 | | ------------ | ------------ | ------------ | ------------ |
53 | | name | 优惠券名称 | `String` | - |
54 | | value | 折扣券优惠金额 | `double` | - |
55 | | valueDesc | 折扣券优惠金额文案 | `String` | - |
56 | | unitDesc | 单位文案 | `String` | - |
57 | | condition | 满减条件 | `String` | - |
58 | | startAt | 卡有效开始时间 (时间戳, 单位秒) | `String` | - |
59 | | endAt | 卡失效日期 (时间戳, 单位秒) | `String` | - |
60 | | description | 描述信息,优惠券可用时展示 | `String` | - |
61 | | reason | 不可用原因,优惠券不可用时展示 | `String` | - |
62 |
--------------------------------------------------------------------------------
/doc/zh/dialog.md:
--------------------------------------------------------------------------------
1 | ## Dialog 弹窗
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NDialog(
9 | title: '标题',
10 | ...
11 | );
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoDialog.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | title | 弹窗标题 | `String` | - |
21 | | message | 弹窗内容 | `String` | - |
22 | | titleAlign | 标题对齐方式 | `AlignmentDirectional` | `center` |
23 | | messageAlign | 内容对齐方式 | `TextAlign` | `center` |
24 | | showConfirmButton | 是否展示确认按钮 | `bool` | `true` |
25 | | showCancelButton | 是否展示取消按钮 | `bool` | `false` |
26 | | confirmButtonText | 确认按钮文案 | `String` | `确认` |
27 | | confirmButtonColor | 确认按钮颜色 | `Color` | `#ffffff` |
28 | | confirmTextColor | 确认按钮文本颜色 | `Color` | `#1989fa` |
29 | | cancelButtonText | 取消按钮文案 | `String` | `取消` |
30 | | cancelButtonColor | 取消按钮颜色 | `Color` | `#ffffff` |
31 | | cancelTextColor | 取消按钮文本颜色 | `Color` | `#323233` |
32 | | closeOnClickOverlay | 是否在点击遮罩层后关闭弹窗 | `bool` | `false` |
33 | | onConfirm | 点击确认按钮时触发 | `Function()` | - |
34 | | onCancel | 点击取消按钮时触发 | `Function()` | - |
35 | | beforeClose | 关闭前的回调函数 | `Function()` | - |
36 | | child | 自定义内容 | `Widget` | - |
37 |
--------------------------------------------------------------------------------
/doc/zh/divider.md:
--------------------------------------------------------------------------------
1 | ## Divider 分割线
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NDivider(
9 | content: "分割线",
10 | )
11 | ```
12 |
13 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoDivider.dart)
14 |
15 | ### API
16 |
17 | | 参数 | 说明 | 类型 | 默认值 |
18 | | ------------ | ------------ | ------------ | ------------ |
19 | | content | 分隔符文字 | `String` | - |
20 | | fontColor | 文字颜色 | `Color` | `#969799` |
21 | | fontSize | 文字大小 | `double` | `14` |
22 | | lineColor | 分割线颜色 | `Color` | `#ebedf0` |
23 | | hairline | 是否为细分割线| `bool` | `false` |
24 | | contentPosition | 文本位置 | `String` | `center` |
25 | | child | 自定义分隔符内容 | `Widget` | - |
26 |
--------------------------------------------------------------------------------
/doc/zh/field.md:
--------------------------------------------------------------------------------
1 | ## Field 输入框
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Field(
9 | placeholder: "请输入用户名",
10 | controller: testInput1,
11 | ...
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoField.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | controller | 控制属性 | `TextEditingController` | - |
22 | | keyboardType | 输入类型| `TextInputType` | - |
23 | | focusNode | 焦点控制 | `FocusNode` | - |
24 | | textInputAction | 键盘右下角的类型| `TextInputAction` | `done` |
25 | | label | 输入框左侧文本 | `String` | - |
26 | | maxLength | 输入的最大字符数 | `int` | - |
27 | | placeholder | 占位提示文字 | `String` | - |
28 | | disabled | 是否禁用输入框 | `bool` | `false` |
29 | | readonly | 是否只读 | `bool` | `false` |
30 | | require | 是否显示表单必填星号 | `bool` | `false` |
31 | | clearable | 是否启用清除控件 | `bool` | `true` |
32 | | autofocus | 自动聚焦 | `bool` | `false` |
33 | | inputFormatters | 检验输入框正则 | `List` | - |
34 | | type | 输入框类型| `String` | `text` |
35 | | rows | 输入框行数,当`type=textarea`可用 | `int` | `2` |
36 | | showWordLimit | 是否显示字数统计,需要设置`maxlength`属性 | `bool` | `false` |
37 | | error | 是否将输入内容标红 | `bool` | `false` |
38 | | errorMessage | 底部错误提示文案 | `String` | - |
39 | | labelWidth | 左侧文本宽度 | `double` | `90.0` |
40 | | labelAlign | 左侧文本对齐方式 | `TextAlign` | `start` |
41 | | inputAlign | 输入框内容对齐方式 | `TextAlign` | `start` |
42 | | leftIcon | 左侧图标 | `IconData` | - |
43 | | clickLeft | 点击左侧图标时触发 | `Function()` | - |
44 | | rightIcon | 右侧图标 | `IconData` | - |
45 | | clickRight | 点击右侧图标时触发 | `Function()` | - |
46 | | right | 自定义右侧内容 | `Widget` | - |
47 | | toolbarOptions | 工具栏定制 | `ToolbarOptions` | - |
48 | | onChange | 输入框内容变化时触发 | `Function(String val)` | - |
49 | | onEditingComplete | 输入框内容编辑结束时触发 | `Function()` | - |
50 | | onClick | 输入框获得焦点时触发 | `Function()` | - |
51 | | onSubmitted | 内容提交(按回车)的回调 | `Function(String val)` | - |
52 | | style | 文本样式 | `TextStyle` | - |
53 |
--------------------------------------------------------------------------------
/doc/zh/goodsAction.md:
--------------------------------------------------------------------------------
1 | ## GoodsAction 商品导航
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | GoodsAction(
9 | actions: [
10 | ActionButtonItem(text: "客服", icon: Icons.chat_bubble_outline),
11 | ...
12 | ],
13 | buttons: [
14 | ButtonItem(
15 | text: "加入购物车",
16 | gradient: LinearGradient(colors: [Color(0xffffd01e), Color(0xffff8917)])
17 | ),
18 | ...
19 | ],
20 | )
21 | ```
22 |
23 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoGoodsAction.dart)
24 |
25 | ### API
26 |
27 | #### GoodsAction
28 |
29 | | 参数 | 说明 | 类型 | 默认值 |
30 | | ------------ | ------------ | ------------ | ------------ |
31 | | actions | 左侧图标按钮 | `List` | - |
32 | | buttons | 右侧按钮 | `List` | - |
33 |
34 | #### ActionButtonItem
35 |
36 | | 参数 | 说明 | 类型 | 默认值 |
37 | | ------------ | ------------ | ------------ | ------------ |
38 | | text | 按钮文字 | `String` | - |
39 | | icon | 图标 | `IconData` | - |
40 | | info | 图标右上角徽标的内容 | `String` | - |
41 | | onClick | 点击后触发 | `Function()` | - |
42 | | customIcon | 自定义图标 | `Widget` | - |
43 | | customText | 自定义文本 | `Widget` | - |
44 |
45 | #### ButtonItem
46 |
47 | | 参数 | 说明 | 类型 | 默认值 |
48 | | ------------ | ------------ | ------------ | ------------ |
49 | | text | 按钮文字 | `String` | - |
50 | | color | 按钮颜色,支持渐变色 | `Color || Gradient` | - |
51 | | disabled | 是否禁用按钮 | `bool` | `false` |
52 | | loading | 按钮是否加载中 | `bool` | `false` |
53 | | onClick | 点击后触发 | `Function()` | - |
54 | | customText | 自定义文本 | `Widget` | - |
55 |
--------------------------------------------------------------------------------
/doc/zh/imagePreview.md:
--------------------------------------------------------------------------------
1 | ## ImagePreview 图片预览
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List images = [
9 | Image.network("https://img.yzcdn.cn/vant/apple-1.jpg"),
10 | Image.network("https://img.yzcdn.cn/vant/apple-2.jpg"),
11 | ...
12 | ];
13 |
14 | showImagePreview(
15 | context: context,
16 | images: images,
17 | );
18 | ```
19 |
20 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoImagePreview.dart)
21 |
22 | ### API
23 |
24 | | 参数 | 说明 | 类型 | 默认值 |
25 | | ------------ | ------------ | ------------ | ------------ |
26 | | images | 需要预览的图片数组 | `List` | - |
27 | | startPosition | 图片预览起始位置索引 | `int` | `0` |
28 | | showIndex | 是否显示页数 | `bool` | `true` |
29 | | showIndicators | 是否显示轮播指示器 | `bool` | `false` |
30 | | swipeDuration | 动画时长 | `Duration` | `Duration(seconds: 1)` |
31 | | closeable | 是否显示关闭图标 | `bool` | `false` |
32 | | close-icon | 关闭图标| `IconData` | - |
33 | | closeIconPosition | 关闭图标位置,可选值为`top-left` `bottom-left` `bottom-right` | `String` | `top-right`|
34 | | onChange | 切换图片时的回调函数 | `Function(int val)` | - |
35 | | onClose | 关闭时触发 | `Function (int index)` | - |
36 |
--------------------------------------------------------------------------------
/doc/zh/imageWall.md:
--------------------------------------------------------------------------------
1 | ## ImageWall 图片选择器
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List images = [
9 | "https://storage.360buyimg.com/mtd/home/111543234387022.jpg",
10 | ...
11 | ];
12 |
13 | ImageWall(
14 | images: images,
15 | count: 6,
16 | ...
17 | )
18 | ```
19 |
20 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoImageWall.dart)
21 |
22 | ### API
23 |
24 | | 参数 | 说明 | 类型 | 默认值 |
25 | | ------------ | ------------ | ------------ | ------------ |
26 | | images | 图片文件数组 | `List` | - |
27 | | multiple | 是否可以多选图片 | `bool` | `false` |
28 | | count | 最多可以选择的图片张数 | `int` | `9` |
29 | | imageFit | 图片预览样式 | `BoxFit` | `contain` |
30 | | uploadBtn | 自定义 button | `Widget` | - |
31 | | onChange | 上传后返回全部图片信息 | `Function(List images)` | - |
32 | | onUpload | 监听图片上传 | `Function(List file)` | - |
33 | | onRemove | 删除图片后的回调 | `Function(String url)` | - |
34 |
--------------------------------------------------------------------------------
/doc/zh/list.md:
--------------------------------------------------------------------------------
1 | ## List 列表
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List _dataList1 = [];
9 | bool _finished1 = false;
10 |
11 | NList(
12 | finished: _finished1,
13 | finishedText: "没有更多了",
14 | child: List.generate(_dataList1.length, (i) => _buildItem(_dataList1[i])),
15 | onLoad: () {
16 | return Future.delayed(const Duration(milliseconds: 300), () {
17 | setState(() {
18 | _dataList1
19 | .addAll(List.generate(10, (i) => i + _dataList1.length));
20 | _finished1 = _dataList1.length >= 40;
21 | });
22 | });
23 | },
24 | )
25 | ```
26 |
27 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoList.dart)
28 |
29 | ### API
30 |
31 | | 参数 | 说明 | 类型 | 默认值 |
32 | | ------------ | ------------ | ------------ | ------------ |
33 | | finished | 是否已加载完成,加载完成后不再触发`onLoad`事件 | `bool` | `false` |
34 | | error | 是否加载失败,加载失败后点击错误提示可以重新触发`onLoad`事件 | `bool` | `false` |
35 | | offset | 滚动条与底部距离小于`offset`时触发`onLoad`事件 | `int` | `30` |
36 | | loadingText | 加载过程中的提示文案 | `String` | `加载中...` |
37 | | finishedText | 加载完成后的提示文案 | `String` | - |
38 | | errorText | 加载失败后的提示文案 | `String` | - |
39 | | child | 列表内内容 | `List` | - |
40 | | onLoad | 滚动条与底部距离小于`offset`时触发 | `Function()` | - |
41 |
--------------------------------------------------------------------------------
/doc/zh/loading.md:
--------------------------------------------------------------------------------
1 | ## Loading 加载
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Loading(
9 | color: Colors.blueAccent,
10 | ...
11 | )
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoLoading.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | text | 加载描述 | `String` | - |
21 | | color | 加载环颜色 | `Color` | `#c9c9c9` |
22 | | size | 加载环大小 | `double` | `30.0` |
23 | | textSize | 加载描述字体大小 | `double` | `14.0` |
24 | | vertical | 是否为垂直排列 | `bool` | `false` |
25 | | loading | 自定义内容 | `Widget` | - |
26 |
--------------------------------------------------------------------------------
/doc/zh/noticeBar.md:
--------------------------------------------------------------------------------
1 | ## NoticeBar 通知栏
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NoticeBar(
9 | text: "XXXX",
10 | ...
11 | ),
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoNoticeBar.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | color | 文本颜色 | `Color` | `#fffbe8` |
21 | | background | 滚动条背景 | `Color` | `#ed6a0c` |
22 | | text | 通知文本内容 | `String` | - |
23 | | leftIcon | 左侧图标 | `IconData` | - |
24 | | mode | 通知栏模式,可选值为`closeable` `link` | `String` | - |
25 | | scrollable | 是否在长度溢出时滚动播放 | `bool` | `true` |
26 | | wrapable | 是否开启文本换行,只在禁用滚动时生效 | `bool` | `true` |
27 | | speed | 滚动速率 | `int` | `5` |
28 | | delay | 动画延迟时间 (s) | `int` | `100` |
29 | | onClose | 关闭通知栏时触发 | `Function()` | - |
30 | | onClick | 点击通知栏时触发 | `Function()` | - |
31 |
--------------------------------------------------------------------------------
/doc/zh/numberKeyboard.md:
--------------------------------------------------------------------------------
1 | ## NumberKeyboard 数字键盘
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | NumberKeyboard(
9 | title: "默认键盘",
10 | closeButtomText: "完成",
11 | ...
12 | ).show(context);
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoNumberKeyboard.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | value | 当前输入值 | `String` | - |
22 | | title | 键盘标题 | `String` | - |
23 | | maxlength | 输入值最大长度 | `int` | - |
24 | | extraKey | 左下角按键内容 | `String` | - |
25 | | closeButtomText | 关闭按钮文字,空则不展示 | `String` | - |
26 | | deleteButtonText | 删除按钮文字 | `String` | `删除` |
27 | | showDeleteKey | 是否展示删除按钮 | `bool` | `true` |
28 | | onChange | 当前输入值改变时触发 | `Function(String val)` | - |
29 | | onSubmitted | 当前输入值等于最大值时触发 | `Function(String val)` | - |
30 | | onClose | 键盘关闭时触发 | `Function()` | - |
31 |
--------------------------------------------------------------------------------
/doc/zh/pagination.md:
--------------------------------------------------------------------------------
1 | ## Pagination 分页
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Pagination(
9 | totalItems: 36,
10 | ...
11 | )
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPagination.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | current | 当前页码 | `int` | `1` |
21 | | totalItems | 总记录数 | `int` | `0` |
22 | | itemsPerPage | 每页记录数 | `int` | `10` |
23 | | mode | 显示模式,可选值为`simple` | `String` | `multi` |
24 | | prevText | 上一页 | `String` | `上一页` |
25 | | nextText | 下一页 | `String` | `下一页` |
26 | | showPageSize | 显示的页码个数 | `int` | `5` |
27 | | onChange | 页码改变时触发 | `Function(int page)` | - |
28 |
--------------------------------------------------------------------------------
/doc/zh/panel.md:
--------------------------------------------------------------------------------
1 | ## Panel 面板
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Panel(
9 | title: "标题",
10 | desc: "描述信息",
11 | ...
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPanel.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | title | 标题 | `String` | - |
22 | | desc | 描述 | `String` | - |
23 | | status | 状态 | `String` | - |
24 | | body | 自定义内容 | `Widget` | - |
25 | | footer | 自定义 footer | `Widget` | - |
26 |
--------------------------------------------------------------------------------
/doc/zh/passwordInput.md:
--------------------------------------------------------------------------------
1 | ## PasswordInput 密码输入框
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | PasswordInput(
9 | value: _value,
10 | info: "密码为 6 位数字",
11 | ...
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPasswordInput.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | value | 密码值 | `String` | - |
22 | | length | 密码最大长度 | `int` | `6` |
23 | | mask | 是否隐藏密码内容 | `bool` | `true` |
24 | | hideWhenSubmitted | 当密码值位数等于最大程度,是否自动隐藏键盘 | `bool` | `false` |
25 | | info | 输入框下方文字提示 | `String` | - |
26 | | onClick | 输入框点击时触发 | `Function()` | - |
27 | | onChange | 密码值改变时触发 | `Function(String val)` | - |
28 | | onSubmitted | 密码值位数等于最大程度时触发 | `Function(String val)` | - |
29 |
--------------------------------------------------------------------------------
/doc/zh/picker.md:
--------------------------------------------------------------------------------
1 | ## Picker 选择器
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Picker(
9 | colums: options
10 | ...
11 | ),
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPicker.dart)
15 |
16 | ### API
17 |
18 | #### Picker
19 |
20 | | 参数 | 说明 | 类型 | 默认值 |
21 | | ------------ | ------------ | ------------ | ------------ |
22 | | colums | 对象数组,配置每一列显示的数据 | `List` | - |
23 | | showToolbar | 是否显示顶部栏 | `bool` | `false` |
24 | | toolbarPosition | 顶部栏位置,可选值为 `bottom` | `String` | `top` |
25 | | title | 顶部栏标题 | `String` | - |
26 | | loading | 是否显示加载状态 | `bool` | `false` |
27 | | itemHeight | 选项高度 | `double` | `44.0` |
28 | | confirmButtonText | 确认按钮文字 | `String` | `确认` |
29 | | cancelButtonText | 取消按钮文字 | `String` | `取消` |
30 | | defaultIndex | 默认选中项索引 | `int || List` | `0 || [0]` |
31 | | level | 多列选择的列数 | `int` | `1` |
32 | | onCancel | 点击取消按钮时触发 | `Function(List selectedValues, dynamic selectedIndex)` | - |
33 | | onConfirm | 点击完成按钮时触发 | `Function(List selectedValues, dynamic selectedIndex)` | - |
34 | | onChange | 选项改变时触发 | `Function(List selectedValues, dynamic selectedIndex)` | - |
35 |
36 | #### PickerItem
37 |
38 | | 参数 | 说明 | 类型 | 默认值 |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | text | 子选项的数据 | `String` | - |
41 | | child | 子选项的下级选项数组 | `List` | - |
42 |
--------------------------------------------------------------------------------
/doc/zh/price.md:
--------------------------------------------------------------------------------
1 | ## Price 商品价格
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Price(
9 | value: 1234.567,
10 | )
11 | ```
12 |
13 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoPrice.dart)
14 |
15 | ### API
16 |
17 | | 参数 | 说明 | 类型 | 默认值 |
18 | | ------------ | ------------ | ------------ | ------------ |
19 | | value | 价格 | `double` | - |
20 | | color | 价格颜色 | `Color` | `#323233` |
21 | | size | 价格大小 | `double` | `20` |
22 | | currency | 货币符号 | `String` | `¥` |
23 | | decimal | 保留的小数点 | `int` | `2` |
24 | | thousands | 是否按照千分号形式显示 | `bool` | `false` |
25 |
--------------------------------------------------------------------------------
/doc/zh/progress.md:
--------------------------------------------------------------------------------
1 | ## Progress 进度条
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Progress(
9 | percentage: 50,
10 | showPivot: true
11 | ...
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoProgress.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | inactive | 是否置灰 | `bool` | `false` |
22 | | percentage | 进度百分比 | `double` | `0` |
23 | | strokeWidth | 进度条粗细 | `double` | `5` |
24 | | showPivot | 是否显示进度条文字 | `bool` | `false` |
25 | | color | 进度条颜色 | `Color` | `#1989fa` |
26 | | textColor | 进度文字颜色 | `Color` | `#ffffff` |
27 | | trackColor | 轨道颜色 | `Color` | `#ebedf0` |
28 | | pivotText | 文字显示 | `String` | - |
29 | | pivotColor | 文字背景色 | `Color` | - |
30 |
--------------------------------------------------------------------------------
/doc/zh/radio.md:
--------------------------------------------------------------------------------
1 | ## Radio 单选框
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | RadioItem(name: "a", text: "单选框1"),
10 | RadioItem(name: "b", text: "单选框2"),
11 | ];
12 |
13 | RadioGroup(
14 | value: 'a',
15 | list: list,
16 | ...
17 | )
18 | ```
19 |
20 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoRadio.dart)
21 |
22 | ### API
23 |
24 | #### RadioGroup
25 |
26 | | 参数 | 说明 | 类型 | 默认值 |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | list | 选项 | `List` | - |
29 | | value | 选中项的标识符 | `String` | - |
30 | | shape | 所有选项的形状 | `String` | `round` |
31 | | inCellGroup | 是否为单元格组件 | `bool` | `false` |
32 | | disabled | 是否禁用所有单选框 | `bool` | `false` |
33 | | iconSize | 所有复选框的图标大小 | `double` | |
34 | | checkedColor | 所有复选框的选中状态颜色 | `Color` | - |
35 | | onChange | 当绑定值变化时触发的事件 | `Function(String val)` | - |
36 |
37 | #### RadioItem
38 |
39 | | 参数 | 说明 | 类型 | 默认值 |
40 | | ------------ | ------------ | ------------ | ------------ |
41 | | name | 标识符 | `String` | - |
42 | | value | 是否选中 | `bool` | `false` |
43 | | shape | 选项的形状,可选值为`square` | `String` | `round` |
44 | | text | 选项的描述 | `String` | - |
45 | | disabled | 是否禁用复选框 | `bool` | `false` |
46 | | iconSize | 图标大小 | `double` | `20` |
47 | | checkedColor | 选中状态颜色 | `Color` | `#1989fa` |
48 |
--------------------------------------------------------------------------------
/doc/zh/rate.md:
--------------------------------------------------------------------------------
1 | ## Rate 评分
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Rate(
9 | icon: Icons.favorite,
10 | ...
11 | )
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoRate.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | count | 图标总数 | `int` | `5` |
21 | | value | 当前分值 | `int` | - |
22 | | size | 图标大小 | `double` | `24.0` |
23 | | gutter | 图标间距 | `double` | `4.0` |
24 | | icon | 自定义图标 | `IconData` | `star` |
25 | | voidIcon | 自定义未选中图标 | `IconData` | `star_border` |
26 | | color | 选中颜色 | `Color` | `#ffd21e` |
27 | | voidColor | 未选中颜色 | `Color` | `#dcdee0` |
28 | | readonly | 是否为只读状态 | `bool` | `false` |
29 | | disabled | 是否为禁用状态 | `bool` | `false` |
30 | | onChange | 当前分值变化时触发的事件 | `Function(String val)` | - |
31 |
--------------------------------------------------------------------------------
/doc/zh/search.md:
--------------------------------------------------------------------------------
1 | ## Search 搜索
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Search(
9 | showAction: true,
10 | ...
11 | )
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSearch.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | shape | 搜索框形状,可选值为`round` | `String` | `square` |
21 | | background | 搜索框背景色 | `Color` | `#f7f8fA` |
22 | | maxLength | 输入的最大字符数 | `int` | `100` |
23 | | placeholder | 占位提示文字 | `String` | `请输入搜索关键词` |
24 | | clearable | 是否启用清除控件 | `bool` | `true` |
25 | | showAction | 是否在搜索框右侧显示取消按钮 | `bool` | `false` |
26 | | actionText | 取消按钮文字 | `String` | `取消` |
27 | | disabled | 是否禁用输入框 | `bool` | `false` |
28 | | readonly | 是否将输入框设为只读 | `bool` | `false` |
29 | | leftIcon | 输入框左侧图标 | `IconData` | `search` |
30 | | rightIcon | 输入框右侧图标 | `IconData` | - |
31 | | left | 自定义左侧内容 | `Widget` | - |
32 | | right | 自定义右侧内容 | `Widget` | - |
33 | | onClickLeft | 点击左侧内容反馈 | `Function()` | - |
34 | | onClickRight | 点击右侧内容反馈 | `Function()` | - |
35 | | onSubmitted | 点击提交按钮反馈 | `Function(String val)` | - |
36 | | onCancel | 点击取消按钮反馈 | `Function()` | - |
37 |
--------------------------------------------------------------------------------
/doc/zh/shareSheet.md:
--------------------------------------------------------------------------------
1 | ## ShareSheet 分享面板
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List options = [
9 | ShareSheetItem(name: "微信"),
10 | ...
11 | ];
12 |
13 | ShareSheet(
14 | title: "立即分享给好友",
15 | options: options
16 | ...
17 | ).show(context);
18 | ```
19 |
20 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoShareSheet.dart)
21 |
22 | ### API
23 |
24 | #### ShareSheetItem
25 |
26 | | 参数 | 说明 | 类型 | 默认值 |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | name | 分享渠道名称 | `String` | - |
29 | | description | 分享选项描述 | `String` | - |
30 | | icon | 分享图标 | `Widget` | - |
31 |
32 | #### ShareSheet
33 |
34 | | 参数 | 说明 | 类型 | 默认值 |
35 | | ------------ | ------------ | ------------ | ------------ |
36 | | options | 分享选项 | `List` | - |
37 | | title | 顶部标题 | `String` | - |
38 | | cancelText | 取消按钮文字 | `String` | - |
39 | | description | 标题下方的辅助描述文字 | `String` | - |
40 | | closeOnClickOverlay | 是否在点击遮罩层后关闭 | `bool` | `true` |
41 | | wrap | 是否多行显示 | `bool` | `false` |
42 | | wrapNumber | 多行显示每行的个数,仅在`wrap=true`生效 | `int` | `4` |
43 | | onSelect | 点击分享选项时触发 | `Function(ShareSheetItem shareSheetItem, int index)` | - |
44 | | onCancel | 点击取消按钮时触发 | `Function()` | - |
45 |
--------------------------------------------------------------------------------
/doc/zh/sidebar.md:
--------------------------------------------------------------------------------
1 | ## Sidebar 侧边导航
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | SideBarItem(
10 | title: "标签名"
11 | ),
12 | SideBarItem(
13 | title: "标签名"
14 | ),
15 | ...
16 | ];
17 |
18 | Sidebar(
19 | list: list,
20 | ...
21 | )
22 | ```
23 |
24 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSidebar.dart)
25 |
26 | ### API
27 |
28 | #### Sidebar
29 |
30 | | 参数 | 说明 | 类型 | 默认值 |
31 | | ------------ | ------------ | ------------ | ------------ |
32 | | active | 当前选项 | `int` | `0` |
33 | | list | 所有选项 | `List` | - |
34 | | onChange | 当前值改变时触发 | `Function(int val)` | - |
35 |
36 | #### SideBarItem
37 |
38 | | 参数 | 说明 | 类型 | 默认值 |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | title | 内容 | `String` | - |
41 | | dot | 是否显示右上角小红点 | `bool` | `false` |
42 | | info | 右上角徽标的内容 | `String` | - |
43 | | disabled | 是否禁用该项 | `bool` | `false` |
44 | | onClick | 点击选项后触发 | `Function(int val)` | - |
45 | | children | 子选项内容 | `List` | - |
46 | | content | 自定义子选项内容 | `Widget` | - |
47 |
--------------------------------------------------------------------------------
/doc/zh/skeleton.md:
--------------------------------------------------------------------------------
1 | ## Skeleton 骨架屏
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Skeleton(
9 | row: 3,
10 | title: true,
11 | ...
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSkeleton.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | row | 段落占位图行数 | `int` | `0` |
22 | | rowWidth | 段落占位图宽度 | `double` | `1` |
23 | | title | 是否显示标题占位图 | `bool` | `false` |
24 | | titleWidth | 标题占位图宽度 | `double` | `.4` |
25 | | avatar | 是否显示头像占位图 | `bool` | `false` |
26 | | avatarSize | 头像占位图大小 | `double` | `36` |
27 | | avatarShape | 头像占位图形状,可选值为`round` | `String` | `suqare` |
28 | | loading | 是否显示占位图 | `bool` | `false` |
29 | | child | 不显示占位图时显示内容 | `Widget` | - |
30 |
--------------------------------------------------------------------------------
/doc/zh/stepper.md:
--------------------------------------------------------------------------------
1 | ## Stepper 步进器
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Steppers(
9 | step: 2,
10 | ...
11 | )
12 | ```
13 |
14 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoStepper.dart)
15 |
16 | ### API
17 |
18 | | 参数 | 说明 | 类型 | 默认值 |
19 | | ------------ | ------------ | ------------ | ------------ |
20 | | value | 当前值 | `double` | - |
21 | | min | 最小值 | `double` | `0` |
22 | | max | 最大值 | `double` | - |
23 | | step | 步长,每次点击时改变的值 | `double` | `1` |
24 | | disabled | 是否禁用步进器 | `bool` | `false` |
25 | | disabledInput | 是否禁用输入框 | `bool` | `false` |
26 | | size | 自定义大小 | `double` | `20.0` |
27 | | inputWidth | 自定义 input 宽度 | `double` | - |
28 | | showPlus | 是否显示增加按钮 | `bool` | `true` |
29 | | showMinus | 是否显示减少按钮 | `bool` | `true` |
30 | | decimalLength | 固定显示的小数位数 | `int` | `0` |
31 | | onChange | 当前值变化时触发的事件 | `Function(String val)` | - |
32 |
--------------------------------------------------------------------------------
/doc/zh/steps.md:
--------------------------------------------------------------------------------
1 | ## Steps 步骤条
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List steps = [
9 | StepItem("买家下单"),
10 | StepItem("商家接单"),
11 | StepItem("买家提货"),
12 | StepItem("交易完成"),
13 | ];
14 |
15 | Steps(
16 | steps: steps,
17 | active: _active
18 | ),
19 | ```
20 |
21 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSteps.dart)
22 |
23 | ### API
24 |
25 | #### Steps
26 |
27 | | 参数 | 说明 | 类型 | 默认值 |
28 | | ------------ | ------------ | ------------ | ------------ |
29 | | steps | 所有步骤 | `List` | - |
30 | | active | 当前步骤 | `int` | `0` |
31 | | direction | 显示方向,可选值为`vertical` | `String` | `horizontal` |
32 | | activeColor | 激活状态颜色 | `Color` | `#07c160` |
33 | | activeIcon | 激活状态图标 | `IconData` | `check_circle` |
34 | | inactiveIcon | 未激活状态图标 | `IconData` | - |
35 |
36 | #### StepItem
37 |
38 | | 参数 | 说明 | 类型 | 默认值 |
39 | | ------------ | ------------ | ------------ | ------------ |
40 | | title | 步骤描述 | `String` | - |
41 | | date | 步骤日期 | `String` | - |
42 |
--------------------------------------------------------------------------------
/doc/zh/submitBar.md:
--------------------------------------------------------------------------------
1 | ## SubmitBar 提交订单栏
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | SubmitBar(
9 | buttonText: "提交订单",
10 | price: 30.50,
11 | ...
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSubmitBar.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | price | 价格 | `double` | - |
22 | | label | 价格左侧文案 | `String` | `合计:` |
23 | | suffixLabel | 价格右侧文案 | `String` | - |
24 | | textAlign | 价格文案对齐方向,可选值为`left` | `String` | `right` |
25 | | buttonText | 按钮文字 | `String` | - |
26 | | tip | 提示文案 | `String` | - |
27 | | tipIcon | 左侧图标 | `IconData` | - |
28 | | disabled | 是否禁用按钮 | `bool` | `false` |
29 | | loading | 是否加载中 | `bool` | `false` |
30 | | currency | 货币符号 | `String` | `¥` |
31 | | decimalLength | 价格小数点后位数 | `int` | `2` |
32 | | onSubmit | 按钮点击事件回调 | `Function()` | - |
33 | | customTip | 提示文案中的额外操作和说明 | `Widget` | - |
34 | | customTop | 自定义订单栏上方内容 | `Widget` | - |
35 | | customLeft | 自定义订单栏左侧内容 | `Widget` | - |
36 |
--------------------------------------------------------------------------------
/doc/zh/swipe.md:
--------------------------------------------------------------------------------
1 | ## Swipe 轮播
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List images = [
9 | Image.network("https://img.yzcdn.cn/vant/apple-1.jpg"),
10 | Image.network("https://img.yzcdn.cn/vant/apple-2.jpg"),
11 | Image.network("https://img.yzcdn.cn/vant/apple-3.jpg"),
12 | Image.network("https://img.yzcdn.cn/vant/apple-4.jpg")
13 | ];
14 |
15 | Swipe(
16 | autoPlay: true,
17 | children: images,
18 | ...
19 | )
20 | ```
21 |
22 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoSwipe.dart)
23 |
24 | ### API
25 |
26 | | 参数 | 说明 | 类型 | 默认值 |
27 | | ------------ | ------------ | ------------ | ------------ |
28 | | autoPlay | 是否自动播放 | `bool` | `false` |
29 | | interval | 自动轮播间隔 | `Duration` | `Duration(seconds: 3)` |
30 | | duration | 动画时长 | `Duration` | `Duration(seconds: 1)` |
31 | | initialSwipe | 初始位置索引值 | `int` | `0` |
32 | | showIndicators | 是否显示指示器 | `bool` | `true` |
33 | | indicatorSize | 指示器大小 | `double` | `8.0` |
34 | | indicatorColor | 指示器颜色 | `Color` | `#1989fa` |
35 | | scrollDirection | 滚动方向,可选值为`vertical` | `String` | `horizontal` |
36 | | curve | 动画效果 | `Curve` | `fastOutSlowIn` |
37 | | onChange | 每一页轮播后触发 | `Function(int val)` | - |
38 | | viewportFraction | 每个页面在滚动方向占据的视窗比例 | `double` | `1.0` |
39 | | children | 显示内容 | `List` | - |
40 | | indicator | 自定义指示器 | `Widget` | - |
41 |
--------------------------------------------------------------------------------
/doc/zh/tag.md:
--------------------------------------------------------------------------------
1 | ## Tag 标签
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | Tag(
9 | type: "primary"
10 | text: "标签",
11 | 。。。
12 | )
13 | ```
14 |
15 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoTag.dart)
16 |
17 | ### API
18 |
19 | | 参数 | 说明 | 类型 | 默认值 |
20 | | ------------ | ------------ | ------------ | ------------ |
21 | | type | 类型,可选值为`primary` `success` `danger` `warning` | `String` | `default` |
22 | | size | 尺寸,可选值为`large` `medium` | `String` | `default` |
23 | | text | 标签内文字 | `String` | - |
24 | | plain | 是否为空心样式 | `bool` | `false` |
25 | | round | 是否为圆角样式 | `bool` | `false` |
26 | | mark | 是否为标记样式 | `bool` | `false` |
27 | | color | 标签颜色 | `Color` | `#1989fa` |
28 | | textColor | 文字颜色,优先于color属性 | `Color` | - |
29 | | onClose | 是否为可关闭标签 | `Function()` | - |
30 |
--------------------------------------------------------------------------------
/doc/zh/treeSelect.md:
--------------------------------------------------------------------------------
1 | ## TreeSelect 分类选择
2 |
3 | ### 使用范例
4 |
5 | ```
6 | import 'package:flutter_vant_kit/main.dart';
7 |
8 | List list = [
9 | SideBarItem(
10 | title: "浙江",
11 | children: [
12 | TreeItem(text: "杭州", id: 1),
13 | TreeItem(text: "温州", id: 2),
14 | TreeItem(text: "宁波", id: 3, disabled: true),
15 | TreeItem(text: "义乌", id: 4),
16 | ]
17 | ),
18 | ...
19 | ];
20 |
21 | TreeSelect(
22 | activeId: [1],
23 | list: list,
24 | )
25 | ```
26 |
27 | 更多例子请参考[Demo](https://github.com/benjaken/flutter_vant_kit/blob/master/example/lib/routes/demoTreeSelect.dart)
28 |
29 | ### API
30 |
31 | #### TreeSelect
32 |
33 | | 参数 | 说明 | 类型 | 默认值 |
34 | | ------------ | ------------ | ------------ | ------------ |
35 | | list | 所有选项 | `List` | - |
36 | | mainActiveIndex | 左侧选中项的索引 | `int` | `0` |
37 | | activeId | 右侧选中项的 id | `List` | - |
38 | | height | 高度 | `double` | `300.0` |
39 | | max | 右侧项最大选中个数 | `int` | `1` |
40 | | onChange | 左侧选中值改变时触发 | `Function(List list)` | - |
41 |
42 | #### TreeItem
43 |
44 | | 参数 | 说明 | 类型 | 默认值 |
45 | | ------------ | ------------ | ------------ | ------------ |
46 | | text | 右侧选项名称 | `String` | - |
47 | | id | 右侧选项标识符 | `int` | - |
48 | | disabled | 是否禁用右侧选中项 | `bool` | `false` |
49 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 41a911099b7d06f7b1c29f4420cfcfe41fd26e46
8 | channel: unknown
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # Flutter Vant Kit Example
2 |
3 | ```
4 | flutter run
5 | ```
6 |
--------------------------------------------------------------------------------
/example/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/example/android/app/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/example/android/app/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | app
4 | Project app created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.buildship.core.gradleprojectbuilder
15 |
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javanature
21 | org.eclipse.buildship.core.gradleprojectnature
22 |
23 |
24 |
--------------------------------------------------------------------------------
/example/android/app/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=..
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | project.setProperty('target-platform', 'android-arm')
25 |
26 | apply plugin: 'com.android.application'
27 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
28 |
29 | android {
30 | compileSdkVersion 28
31 |
32 | lintOptions {
33 | disable 'InvalidPackage'
34 | }
35 |
36 | defaultConfig {
37 | applicationId "com.nero.uikit"
38 | minSdkVersion 21
39 | targetSdkVersion 28
40 | versionCode flutterVersionCode.toInteger()
41 | versionName flutterVersionName
42 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
43 | ndk {
44 | //选择要添加的对应cpu类型的.so库。
45 | abiFilters 'x86', 'armeabi', 'armeabi-v7a', 'armeabi-v8a'
46 | // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
47 | }
48 |
49 | manifestPlaceholders = [
50 | JPUSH_PKGNAME : applicationId,
51 | JPUSH_APPKEY : "0a388c1fd1c6910f81e38772", //JPush上注册的包名对应的appkey.
52 | JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
53 | ]
54 | }
55 |
56 | buildTypes {
57 | release {
58 | // TODO: Add your own signing config for the release build.
59 | // Signing with the debug keys for now, so `flutter run --release` works.
60 | signingConfig signingConfigs.debug
61 | }
62 | }
63 | }
64 |
65 | flutter {
66 | source '../..'
67 | }
68 |
69 | dependencies {
70 | testImplementation 'junit:junit:4.12'
71 | androidTestImplementation 'androidx.test:runner:1.1.0'
72 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
73 | }
--------------------------------------------------------------------------------
/example/android/app/src/main/java/club/flutterchina/flutterinaction/MainActivity.java:
--------------------------------------------------------------------------------
1 | package club.flutterchina.flutterinaction;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 |
5 | public class MainActivity extends FlutterActivity {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
15 |
16 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | google()
4 | jcenter()
5 | }
6 |
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:3.3.1'
9 | }
10 | }
11 |
12 | allprojects {
13 | repositories {
14 | google()
15 | jcenter()
16 | }
17 | }
18 |
19 | rootProject.buildDir = '../build'
20 | subprojects {
21 | project.buildDir = "${rootProject.buildDir}/${project.name}"
22 | }
23 | subprojects {
24 | project.evaluationDependsOn(':app')
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.enableJetifier=true
4 | android.useAndroidX=true
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/example/i18nconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultLocale": "en-US",
3 | "locales": [
4 | "en-US"
5 | ],
6 | "localePath": "i18n",
7 | "generatedPath": "lib/generated",
8 | "ltr": [
9 | "en-US"
10 | ],
11 | "rtl": []
12 | }
--------------------------------------------------------------------------------
/example/imgs/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/imgs/avatar.png
--------------------------------------------------------------------------------
/example/ios/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // Runner
4 | //
5 | // Created by Nero Chen on 2019/11/20.
6 | // Copyright © 2019 The Chromium Authors. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Flutter.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # NOTE: This podspec is NOT to be published. It is only used as a local source!
3 | # This is a generated file; do not edit or check into version control.
4 | #
5 |
6 | Pod::Spec.new do |s|
7 | s.name = 'Flutter'
8 | s.version = '1.0.0'
9 | s.summary = 'High-performance, high-fidelity mobile apps.'
10 | s.homepage = 'https://flutter.io'
11 | s.license = { :type => 'MIT' }
12 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
13 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
14 | s.ios.deployment_target = '8.0'
15 | # Framework linking is handled by Flutter tooling, not CocoaPods.
16 | # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
17 | s.vendored_frameworks = 'path/to/nothing'
18 | end
19 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/flutter_export_environment.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # This is a generated file; do not edit or check into version control.
3 | export "FLUTTER_ROOT=/Users/nerochen/development/flutter"
4 | export "FLUTTER_APPLICATION_PATH=/Users/nerochen/Documents/Personal/flutter_vant_kit/example"
5 | export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6 | export "FLUTTER_TARGET=/Users/nerochen/Documents/Personal/flutter_vant_kit/example/lib/main.dart"
7 | export "FLUTTER_BUILD_DIR=build"
8 | export "SYMROOT=${SOURCE_ROOT}/../build/ios"
9 | export "FLUTTER_BUILD_NAME=1.0.0"
10 | export "FLUTTER_BUILD_NUMBER=1"
11 | export "DART_DEFINES=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
12 | export "DART_OBFUSCATION=false"
13 | export "TRACK_WIDGET_CREATION=true"
14 | export "TREE_SHAKE_ICONS=false"
15 | export "PACKAGE_CONFIG=/Users/nerochen/Documents/Personal/flutter_vant_kit/example/.dart_tool/package_config.json"
16 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/example/ios/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Use this file to import your target's public headers that you would like to expose to Swift.
3 | //
4 |
5 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/lib/routes/demoAddressEdit.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoAddressEdit extends StatefulWidget {
7 | @override
8 | _DemoAddressEdit createState() => _DemoAddressEdit();
9 | }
10 |
11 | class _DemoAddressEdit extends State {
12 | var textController = TextEditingController();
13 |
14 | Widget title(String title) {
15 | return Padding(
16 | padding: EdgeInsets.symmetric(vertical: 20, horizontal: 12),
17 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
18 | );
19 | }
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return SingleChildScrollView(
24 | child: Column(
25 | crossAxisAlignment: CrossAxisAlignment.start,
26 | children: [
27 | title(I18n.of(context)!.basic_usage),
28 | AddressEdit(
29 | showDelete: true,
30 | showSetDefault: true,
31 | addressInfo: {
32 | "name": I18n.of(context)!.example_name,
33 | "tel": "18345234123",
34 | "province": I18n.of(context)!.example_province,
35 | "city": I18n.of(context)!.example_city,
36 | "county": I18n.of(context)!.example_county,
37 | "provinceId": 0,
38 | "cityId": 1,
39 | "countyId": 0,
40 | "addressDetail": I18n.of(context)!.example_address,
41 | "postalCode": "515000",
42 | "isDefault": true
43 | },
44 | children: [
45 | Field(
46 | label: I18n.of(context)!.remark,
47 | placeholder: I18n.of(context)!.placeholder_remark,
48 | controller: textController,
49 | )
50 | ],
51 | onSave: (map) {
52 | Utils.toast("Saved! ${map.toString()}");
53 | },
54 | )
55 | ],
56 | ),
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/example/lib/routes/demoAddressList.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoAddressList extends StatefulWidget {
7 | @override
8 | _DemoAddressList createState() => _DemoAddressList();
9 | }
10 |
11 | class _DemoAddressList extends State {
12 | Widget title(String title) {
13 | return Padding(
14 | padding: EdgeInsets.only(bottom: 20),
15 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
16 | );
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | List list = [
22 | AddressInfo(
23 | name: I18n.of(context)!.example_name,
24 | tel: "18345234123",
25 | province: I18n.of(context)!.example_province,
26 | city: I18n.of(context)!.example_city,
27 | county: I18n.of(context)!.example_county,
28 | addressDetail: I18n.of(context)!.example_address,
29 | postalCode: "515000",
30 | isDefault: true),
31 | AddressInfo(
32 | name: I18n.of(context)!.example_name2,
33 | tel: "18345234123",
34 | province: I18n.of(context)!.example_province,
35 | city: I18n.of(context)!.example_city,
36 | county: I18n.of(context)!.example_county,
37 | addressDetail: I18n.of(context)!.example_address,
38 | postalCode: "515000",
39 | isDefault: false),
40 | ];
41 | List disabledList = [
42 | AddressInfo(
43 | name: I18n.of(context)!.example_name3,
44 | tel: "18345234123",
45 | province: I18n.of(context)!.example_province,
46 | city: I18n.of(context)!.example_city,
47 | county: I18n.of(context)!.example_county,
48 | addressDetail: I18n.of(context)!.example_address,
49 | postalCode: "515000",
50 | isDefault: false)
51 | ];
52 |
53 | return AddressList(
54 | id: 0,
55 | list: list,
56 | top: title(I18n.of(context)!.basic_usage),
57 | disabledList: disabledList,
58 | onSelect: (item, i) {
59 | Utils.toast(item.toString());
60 | },
61 | onEdit: (item, i) {
62 | Utils.toast(I18n.of(context)!.edit);
63 | },
64 | onAdd: () {
65 | Utils.toast(I18n.of(context)!.add);
66 | },
67 | );
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/example/lib/routes/demoAvatar.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoAvatar extends StatefulWidget {
7 | @override
8 | _DemoAvatar createState() => _DemoAvatar();
9 | }
10 |
11 | class _DemoAvatar extends State {
12 | Widget title(String title) {
13 | return Padding(
14 | padding: EdgeInsets.symmetric(vertical: 20),
15 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
16 | );
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return SingleChildScrollView(
22 | child: Column(
23 | crossAxisAlignment: CrossAxisAlignment.start,
24 | children: [
25 | title(I18n.of(context)!.basic_usage),
26 | Wrap(
27 | spacing: 12,
28 | crossAxisAlignment: WrapCrossAlignment.center,
29 | children: [
30 | Avatar(type: 'large'),
31 | Avatar(),
32 | Avatar(type: 'small'),
33 | ],
34 | ),
35 | title(I18n.of(context)!.shape_type),
36 | Wrap(
37 | spacing: 12,
38 | crossAxisAlignment: WrapCrossAlignment.center,
39 | children: [
40 | Avatar(type: 'large', shape: "square"),
41 | Avatar(shape: "square"),
42 | Avatar(type: 'small', shape: "square"),
43 | ],
44 | ),
45 | title(I18n.of(context)!.change_color),
46 | Avatar(color: Colors.blueAccent, iconColor: Colors.white),
47 | title(I18n.of(context)!.custom_content),
48 | Wrap(
49 | spacing: 12,
50 | crossAxisAlignment: WrapCrossAlignment.center,
51 | children: [
52 | Avatar(
53 | custom: Text("U"),
54 | ),
55 | Avatar(image: NetworkImage("https://img.yzcdn.cn/vant/cat.jpeg")),
56 | Avatar(
57 | custom: Image.network(
58 | "http://img10.360buyimg.com/uba/jfs/t1/69001/30/2126/550/5d06f947Effd02898/95f18e668670e598.png",
59 | width: 20),
60 | ),
61 | ],
62 | ),
63 | title(I18n.of(context)!.click_event),
64 | Avatar(
65 | onClick: () {
66 | Utils.toast(I18n.of(context)!.clicked);
67 | },
68 | ),
69 | ],
70 | ),
71 | );
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/example/lib/routes/demoCircle.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoCircle extends StatefulWidget {
6 | @override
7 | _DemoCircle createState() => _DemoCircle();
8 | }
9 |
10 | class _DemoCircle extends State {
11 | double percentage = 70;
12 |
13 | Widget title(String title) {
14 | return Padding(
15 | padding: EdgeInsets.symmetric(vertical: 20),
16 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
17 | );
18 | }
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return SingleChildScrollView(
23 | child: Column(
24 | crossAxisAlignment: CrossAxisAlignment.start,
25 | children: [
26 | title(I18n.of(context)!.basic_usage),
27 | Progress(
28 | percentage: 30,
29 | type: "circular",
30 | showPivot: true,
31 | circularSize: 120),
32 | title(I18n.of(context)!.custom_style),
33 | Row(
34 | children: [
35 | NButton(
36 | text: I18n.of(context)!.increase,
37 | type: "primary",
38 | onClick: () {
39 | setState(() {
40 | percentage += 10;
41 | });
42 | },
43 | ),
44 | SizedBox(width: 6),
45 | NButton(
46 | text: I18n.of(context)!.reduce,
47 | type: "danger",
48 | onClick: () {
49 | setState(() {
50 | percentage -= 10;
51 | });
52 | },
53 | )
54 | ],
55 | ),
56 | Progress(
57 | percentage: percentage,
58 | type: "circular",
59 | showPivot: true,
60 | strokeWidth: 10,
61 | pivotText: I18n.of(context)!.custom_width),
62 | Progress(
63 | percentage: percentage,
64 | type: "circular",
65 | showPivot: true,
66 | color: Colors.redAccent,
67 | pivotText: I18n.of(context)!.custom_color),
68 | Progress(
69 | percentage: percentage,
70 | type: "circular",
71 | showPivot: true,
72 | circularSize: 150,
73 | color: Colors.purple,
74 | pivotText: I18n.of(context)!.custom_size),
75 | SizedBox(
76 | height: 20,
77 | )
78 | ],
79 | ),
80 | );
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/example/lib/routes/demoContactCard.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:example/utils/index.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoContactCard extends StatefulWidget {
7 | @override
8 | _DemoContactCard createState() => _DemoContactCard();
9 | }
10 |
11 | class _DemoContactCard extends State {
12 | Widget title(String title) {
13 | return Padding(
14 | padding: EdgeInsets.symmetric(vertical: 20, horizontal: 16),
15 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
16 | );
17 | }
18 |
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.add_contacts),
25 | ContactCard(
26 | type: 'add', onClick: () => {Utils.toast(I18n.of(context)!.add)}),
27 | title(I18n.of(context)!.add_contacts),
28 | ContactCard(
29 | type: 'edit',
30 | name: I18n.of(context)!.example_name,
31 | tel: '13000000000',
32 | onClick: () => {Utils.toast(I18n.of(context)!.edit)},
33 | ),
34 | title(I18n.of(context)!.disabled_edit),
35 | ContactCard(
36 | type: 'edit',
37 | name: I18n.of(context)!.example_name,
38 | tel: '13000000000',
39 | editAble: false)
40 | ],
41 | ),
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/example/lib/routes/demoCoupon.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:intl/intl.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoCoupon extends StatefulWidget {
7 | @override
8 | _DemoCoupon createState() => _DemoCoupon();
9 | }
10 |
11 | class _DemoCoupon extends State {
12 | String? _discount;
13 | int? _chosenCoupon;
14 |
15 | Widget title(String title) {
16 | return Padding(
17 | padding: EdgeInsets.all(20),
18 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
19 | );
20 | }
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | List coupons = List.generate(10, (i) {
25 | return CouponItem(
26 | condition: I18n.of(context)!.example_coupon_condition,
27 | description: I18n.of(context)!.description,
28 | reason: I18n.of(context)!.example_coupon_reason,
29 | value: 150,
30 | name: I18n.of(context)!.example_coupon_name,
31 | startAt: DateFormat("yyyy-MM-dd").format(DateTime.parse("20170310")),
32 | endAt: DateFormat("yyyy-MM-dd").format(DateTime.parse("20171210")),
33 | valueDesc: i % 2 == 0 ? '8.5' : '1.5',
34 | unitDesc:
35 | i % 2 == 0 ? I18n.of(context)!.discount : I18n.of(context)!.yuan);
36 | });
37 | return SingleChildScrollView(
38 | child: Column(
39 | crossAxisAlignment: CrossAxisAlignment.start,
40 | children: [
41 | title(I18n.of(context)!.basic_usage),
42 | Cell(
43 | title: I18n.of(context)!.coupon,
44 | value: _discount ?? "${coupons.length}${I18n.of(context)!.available}",
45 | isLink: true,
46 | onClick: () {
47 | Coupon(
48 | chosenCoupon: _chosenCoupon,
49 | coupons: coupons,
50 | disabledCoupons: coupons.sublist(0, 2),
51 | onSelect: (val) {
52 | setState(() {
53 | _chosenCoupon = val;
54 | String value = (coupons[val].value! / 100).toStringAsFixed(2);
55 | _discount = "-¥$value";
56 | });
57 | },
58 | ).show(context);
59 | },
60 | )
61 | ],
62 | ));
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/example/lib/routes/demoDivider.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoDivider extends StatefulWidget {
6 | @override
7 | _DemoDivider createState() => _DemoDivider();
8 | }
9 |
10 | class _DemoDivider extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.symmetric(vertical: 20),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.basic_usage),
25 | NDivider(),
26 | title(I18n.of(context)!.display_text),
27 | NDivider(
28 | content: I18n.of(context)!.divider,
29 | ),
30 | title(I18n.of(context)!.content_position),
31 | NDivider(
32 | content: I18n.of(context)!.divider,
33 | contentPosition: 'left',
34 | ),
35 | SizedBox(height: 10),
36 | NDivider(
37 | content: I18n.of(context)!.divider,
38 | contentPosition: 'right',
39 | ),
40 | title(I18n.of(context)!.hairline_divider),
41 | NDivider(
42 | content: I18n.of(context)!.divider,
43 | hairline: true,
44 | ),
45 | title(I18n.of(context)!.custom_color),
46 | NDivider(
47 | lineColor: Colors.redAccent,
48 | fontColor: Colors.redAccent,
49 | content: I18n.of(context)!.no_more),
50 | SizedBox(height: 10),
51 | NDivider(
52 | lineColor: Colors.orangeAccent,
53 | fontColor: Colors.orangeAccent,
54 | content: I18n.of(context)!.no_more),
55 | SizedBox(height: 10),
56 | NDivider(
57 | lineColor: Colors.blueAccent,
58 | fontColor: Colors.blueAccent,
59 | content: I18n.of(context)!.no_more),
60 | title(I18n.of(context)!.custom_content),
61 | NDivider(child: Icon(Icons.cancel, color: Colors.blueAccent)),
62 | SizedBox(
63 | height: 20,
64 | )
65 | ],
66 | ),
67 | );
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/example/lib/routes/demoImageWall.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoImageWall extends StatefulWidget {
7 | @override
8 | _DemoImageWall createState() => _DemoImageWall();
9 | }
10 |
11 | class _DemoImageWall extends State {
12 | List images = [
13 | "https://img.yzcdn.cn/vant/leaf.jpg",
14 | "https://img.yzcdn.cn/vant/tree.jpg",
15 | "https://img.yzcdn.cn/vant/sand.jpg",
16 | ];
17 |
18 | Widget title(String title) {
19 | return Padding(
20 | padding: EdgeInsets.symmetric(horizontal: 12, vertical: 20),
21 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
22 | );
23 | }
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | return SingleChildScrollView(
28 | child: Column(
29 | crossAxisAlignment: CrossAxisAlignment.start,
30 | children: [
31 | title(I18n.of(context)!.basic_usage),
32 | ImageWall(
33 | images: images,
34 | count: 6,
35 | onUpload: (files) async {
36 | return Utils.toast(files.toString());
37 | },
38 | onChange: (image) {},
39 | ),
40 | title(I18n.of(context)!.multiple_image),
41 | ImageWall(
42 | images: images,
43 | count: 6,
44 | multiple: true,
45 | onUpload: (files) async {
46 | return Utils.toast(files.toString());
47 | },
48 | onChange: (image) {},
49 | ),
50 | title(I18n.of(context)!.image_zoom_mode),
51 | ImageWall(
52 | images: images,
53 | imageFit: BoxFit.contain,
54 | onUpload: (files) async {
55 | return Utils.toast(files.toString());
56 | },
57 | onChange: (image) {},
58 | )
59 | ],
60 | ));
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/example/lib/routes/demoLoading.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoLoading extends StatefulWidget {
6 | @override
7 | _DemoLoading createState() => _DemoLoading();
8 | }
9 |
10 | class _DemoLoading extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.basic_usage),
25 | Loading(),
26 | title(I18n.of(context)!.custom_color),
27 | Loading(
28 | color: Colors.blueAccent,
29 | ),
30 | title(I18n.of(context)!.load_text),
31 | Loading(
32 | color: Colors.blueAccent,
33 | text: I18n.of(context)!.loading,
34 | ),
35 | title(I18n.of(context)!.vertical_arrangement),
36 | Loading(
37 | color: Colors.blueAccent,
38 | text: I18n.of(context)!.loading,
39 | size: 20,
40 | vertical: true,
41 | ),
42 | title(I18n.of(context)!.custom_loading),
43 | Container(
44 | width: 100,
45 | child: Loading(
46 | loading: Image.network(
47 | "https://loading.io/mod/spinner/lava-lamp/sample.gif"),
48 | text: I18n.of(context)!.loading,
49 | ),
50 | ),
51 | title(I18n.of(context)!.show_loading),
52 | NButton(
53 | text: I18n.of(context)!.show_loading,
54 | type: "primary",
55 | onClick: () {
56 | showDialog(
57 | context: context,
58 | barrierDismissible: true,
59 | builder: (context) {
60 | return Center(
61 | child: Container(
62 | decoration: BoxDecoration(
63 | borderRadius: BorderRadius.circular(4.0),
64 | color: Colors.white),
65 | padding: EdgeInsets.all(20),
66 | child: Loading(
67 | color: Colors.blueAccent,
68 | text: I18n.of(context)!.loading,
69 | ),
70 | ),
71 | );
72 | });
73 | },
74 | )
75 | ],
76 | ),
77 | );
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/example/lib/routes/demoNoticeBar.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoNoticeBar extends StatefulWidget {
7 | @override
8 | _DemoNoticeBar createState() => _DemoNoticeBar();
9 | }
10 |
11 | class _DemoNoticeBar extends State {
12 | Widget title(String title) {
13 | return Padding(
14 | padding: EdgeInsets.fromLTRB(16, 30, 0, 10),
15 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
16 | );
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return ListView(
22 | children: [
23 | title(I18n.of(context)!.basic_usage),
24 | NoticeBar(
25 | text: I18n.of(context)!.example_notice_bar,
26 | leftIcon: Icons.volume_up,
27 | ),
28 | title(I18n.of(context)!.no_scrolling),
29 | NoticeBar(
30 | scrollable: false,
31 | leftIcon: Icons.volume_up,
32 | text: I18n.of(context)!.example_notice_bar,
33 | ),
34 | title(I18n.of(context)!.multi_line_display),
35 | NoticeBar(
36 | scrollable: false,
37 | wrapable: true,
38 | text: I18n.of(context)!.example_notice_bar,
39 | ),
40 | title(I18n.of(context)!.notice_bar_mode),
41 | NoticeBar(
42 | text: I18n.of(context)!.example_notice_bar,
43 | mode: "closeable",
44 | onClose: () {
45 | Utils.toast("NoticeBar closed");
46 | },
47 | ),
48 | SizedBox(
49 | height: 4,
50 | ),
51 | NoticeBar(
52 | text: I18n.of(context)!.example_notice_bar,
53 | mode: "link",
54 | onClick: () {
55 | Utils.toast("NoticeBar clicked");
56 | },
57 | ),
58 | title(I18n.of(context)!.custom_style),
59 | NoticeBar(
60 | text: I18n.of(context)!.example_notice_bar,
61 | leftIcon: Icons.info_outline,
62 | background: Color(0xffecf9ff),
63 | color: Color(0xff1989fa),
64 | )
65 | ],
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/example/lib/routes/demoNumberKeyboard.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoNumberKeyboard extends StatefulWidget {
6 | @override
7 | _DemoNumberKeyboard createState() => _DemoNumberKeyboard();
8 | }
9 |
10 | class _DemoNumberKeyboard extends State {
11 | TextEditingController testInput = TextEditingController();
12 |
13 | Widget title(String title) {
14 | return Padding(
15 | padding: EdgeInsets.symmetric(vertical: 20),
16 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
17 | );
18 | }
19 |
20 | @override
21 | Widget build(BuildContext context) {
22 | return SingleChildScrollView(
23 | child: Column(
24 | crossAxisAlignment: CrossAxisAlignment.start,
25 | children: [
26 | title(I18n.of(context)!.basic_usage),
27 | NButton(
28 | text: I18n.of(context)!.show_default_keyboard,
29 | type: "primary",
30 | onClick: () {
31 | NumberKeyboard(
32 | title: I18n.of(context)!.default_keyboard,
33 | closeButtomText: I18n.of(context)!.finish,
34 | extraKey: ".",
35 | ).show(context);
36 | },
37 | ),
38 | title(I18n.of(context)!.two_way_binding),
39 | Field(
40 | placeholder: I18n.of(context)!.placeholder_input,
41 | controller: testInput,
42 | readonly: true,
43 | onClick: () {
44 | NumberKeyboard(
45 | value: testInput.text,
46 | maxlength: 6,
47 | closeButtomText: I18n.of(context)!.finish,
48 | extraKey: ".",
49 | onChange: (String val) {
50 | setState(() {
51 | testInput.text = val;
52 | });
53 | }).show(context);
54 | },
55 | ),
56 | ],
57 | ));
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/example/lib/routes/demoPagination.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoPagination extends StatefulWidget {
6 | @override
7 | _DemoPagination createState() => _DemoPagination();
8 | }
9 |
10 | class _DemoPagination extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.fromLTRB(0, 20, 0, 20),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.basic_usage),
25 | Pagination(
26 | totalItems: 36,
27 | ),
28 | title(I18n.of(context)!.simple_mode),
29 | Pagination(
30 | totalItems: 120,
31 | mode: 'simple',
32 | ),
33 | ],
34 | ));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/example/lib/routes/demoPanel.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoPanel extends StatefulWidget {
6 | @override
7 | _DemoPanel createState() => _DemoPanel();
8 | }
9 |
10 | class _DemoPanel extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.symmetric(vertical: 20, horizontal: 16),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.basic_usage),
25 | Panel(
26 | title: I18n.of(context)!.title,
27 | desc: I18n.of(context)!.description,
28 | status: I18n.of(context)!.status,
29 | body: Column(
30 | mainAxisSize: MainAxisSize.max,
31 | children: [Text(I18n.of(context)!.content)],
32 | )),
33 | title(I18n.of(context)!.advanced_usage),
34 | Panel(
35 | title: I18n.of(context)!.title,
36 | desc: I18n.of(context)!.description,
37 | status: I18n.of(context)!.status,
38 | body: Column(
39 | mainAxisSize: MainAxisSize.max,
40 | children: [Text(I18n.of(context)!.content)],
41 | ),
42 | footer: Row(
43 | mainAxisAlignment: MainAxisAlignment.end,
44 | children: [
45 | NButton(
46 | padding: EdgeInsets.symmetric(vertical: 6, horizontal: 12),
47 | type: "danger",
48 | size: "small",
49 | width: 60,
50 | text: I18n.of(context)!.confirm,
51 | onClick: () => {},
52 | ),
53 | SizedBox(width: 8),
54 | NButton(
55 | padding: EdgeInsets.symmetric(vertical: 6, horizontal: 12),
56 | size: "small",
57 | width: 60,
58 | text: I18n.of(context)!.cancel,
59 | onClick: () => {},
60 | ),
61 | ],
62 | ),
63 | ),
64 | ]),
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/example/lib/routes/demoPasswordInput.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoPasswordInput extends StatefulWidget {
7 | @override
8 | _DemoPasswordInput createState() => _DemoPasswordInput();
9 | }
10 |
11 | class _DemoPasswordInput extends State {
12 | String _value = "123";
13 |
14 | Widget title(String title) {
15 | return Padding(
16 | padding: EdgeInsets.symmetric(vertical: 20),
17 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
18 | );
19 | }
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return SingleChildScrollView(
24 | child: Column(
25 | crossAxisAlignment: CrossAxisAlignment.start,
26 | children: [
27 | title(I18n.of(context)!.basic_usage),
28 | PasswordInput(
29 | value: _value,
30 | info: I18n.of(context)!.tip_password,
31 | onSubmitted: (val) {
32 | Utils.toast("onSubmitted $val");
33 | },
34 | ),
35 | title(I18n.of(context)!.custom_length),
36 | PasswordInput(
37 | value: "1234", info: I18n.of(context)!.placeholder_code, length: 4),
38 | title(I18n.of(context)!.clear_text_display),
39 | PasswordInput(
40 | value: "12",
41 | mask: false,
42 | )
43 | ],
44 | ));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/example/lib/routes/demoPrice.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoPrice extends StatefulWidget {
6 | @override
7 | _DemoPrice createState() => _DemoPrice();
8 | }
9 |
10 | class _DemoPrice extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.symmetric(vertical: 20),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.basic_usage),
25 | Price(
26 | value: 1234.567,
27 | ),
28 | title(I18n.of(context)!.keep_three_decimal),
29 | Price(
30 | value: 1234.567,
31 | decimal: 3,
32 | ),
33 | title(I18n.of(context)!.custom_decimal),
34 | Price(
35 | currency: "\$",
36 | color: Colors.red,
37 | value: 1234.567,
38 | ),
39 | title(I18n.of(context)!.display_in_thousands),
40 | Price(
41 | thousands: true,
42 | value: 10010.01,
43 | ),
44 | ],
45 | ),
46 | );
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/example/lib/routes/demoProgress.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoProgress extends StatefulWidget {
6 | @override
7 | _DemoProgress createState() => _DemoProgress();
8 | }
9 |
10 | class _DemoProgress extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.symmetric(vertical: 20),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return SingleChildScrollView(
21 | child: Column(
22 | crossAxisAlignment: CrossAxisAlignment.start,
23 | children: [
24 | title(I18n.of(context)!.basic_usage),
25 | Progress(percentage: 50, showPivot: true),
26 | title(I18n.of(context)!.line_thickness),
27 | Progress(percentage: 50, strokeWidth: 8, showPivot: true),
28 | title(I18n.of(context)!.ash),
29 | Progress(percentage: 50, inactive: true, showPivot: true),
30 | title(I18n.of(context)!.custom_style),
31 | Column(
32 | children: [
33 | Progress(
34 | percentage: 30,
35 | color: Colors.orangeAccent,
36 | pivotColor: Colors.orangeAccent,
37 | pivotText: I18n.of(context)!.orange,
38 | showPivot: true),
39 | Progress(
40 | percentage: 50,
41 | color: Colors.redAccent,
42 | pivotColor: Colors.redAccent,
43 | pivotText: I18n.of(context)!.red,
44 | showPivot: true),
45 | Progress(
46 | percentage: 70,
47 | color: Colors.purple,
48 | pivotColor: Colors.purple,
49 | pivotText: I18n.of(context)!.purple,
50 | showPivot: true)
51 | ],
52 | ),
53 | ],
54 | ),
55 | );
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/example/lib/routes/demoRadio.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoRadio extends StatefulWidget {
6 | @override
7 | _DemoRadio createState() => _DemoRadio();
8 | }
9 |
10 | class _DemoRadio extends State {
11 | Widget title(String title) {
12 | return Padding(
13 | padding: EdgeInsets.symmetric(vertical: 20),
14 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
15 | );
16 | }
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | List list = [
21 | RadioItem(name: "a", text: I18n.of(context)!.radio),
22 | RadioItem(name: "b", text: I18n.of(context)!.radio),
23 | ];
24 | return SingleChildScrollView(
25 | child: Column(
26 | crossAxisAlignment: CrossAxisAlignment.start,
27 | children: [
28 | title(I18n.of(context)!.basic_usage),
29 | RadioGroup(
30 | value: 'a',
31 | list: list,
32 | ),
33 | title(I18n.of(context)!.disabled_status),
34 | RadioGroup(list: list, value: 'a', disabled: true),
35 | title(I18n.of(context)!.custom_color),
36 | RadioGroup(list: list, value: 'a', checkedColor: Colors.green),
37 | title(I18n.of(context)!.custom_shape),
38 | RadioGroup(
39 | list: list,
40 | value: 'a',
41 | shape: 'square',
42 | ),
43 | title(I18n.of(context)!.use_with_cell),
44 | RadioGroup(
45 | list: list,
46 | value: 'a',
47 | inCellGroup: true,
48 | ),
49 | ],
50 | ));
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/example/lib/routes/demoRate.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoRate extends StatefulWidget {
7 | @override
8 | _DemoRate createState() => _DemoRate();
9 | }
10 |
11 | class _DemoRate extends State {
12 | Widget title(String title) {
13 | return Padding(
14 | padding: EdgeInsets.symmetric(vertical: 20),
15 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
16 | );
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return SingleChildScrollView(
22 | padding: EdgeInsets.all(20.0),
23 | child: Column(
24 | crossAxisAlignment: CrossAxisAlignment.start,
25 | children: [
26 | title(I18n.of(context)!.basic_usage),
27 | Rate(
28 | value: 3,
29 | ),
30 | title(I18n.of(context)!.custom_icon),
31 | Rate(
32 | value: 3,
33 | icon: Icons.favorite,
34 | voidIcon: Icons.favorite_border,
35 | onChange: (val) {
36 | Utils.toast("Rate changed: $val");
37 | },
38 | ),
39 | title(I18n.of(context)!.custom_style),
40 | Rate(
41 | value: 3,
42 | color: Colors.blueAccent,
43 | voidColor: Colors.blueAccent,
44 | size: 36.0,
45 | gutter: 8.0,
46 | onChange: (val) {
47 | Utils.toast("Rate changed: $val");
48 | },
49 | ),
50 | title(I18n.of(context)!.custom_number),
51 | Rate(
52 | count: 7,
53 | value: 4,
54 | ),
55 | title(I18n.of(context)!.disabled_status),
56 | Rate(value: 3, disabled: true),
57 | title(I18n.of(context)!.readonly_status),
58 | Rate(value: 3, readonly: true)
59 | ]));
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/example/lib/routes/demoSearch.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoSearch extends StatefulWidget {
7 | @override
8 | _DemoSearch createState() => _DemoSearch();
9 | }
10 |
11 | class _DemoSearch extends State {
12 | IconData _icon = Icons.star_border;
13 | Color _color = Colors.grey;
14 |
15 | Widget title(String title) {
16 | return Padding(
17 | padding: EdgeInsets.fromLTRB(20, 30, 0, 10),
18 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
19 | );
20 | }
21 |
22 | @override
23 | Widget build(BuildContext context) {
24 | return SingleChildScrollView(
25 | child: Column(
26 | crossAxisAlignment: CrossAxisAlignment.start,
27 | children: [
28 | title(I18n.of(context)!.basic_usage),
29 | Search(),
30 | title(I18n.of(context)!.event_monitor),
31 | Search(
32 | showAction: true,
33 | onSubmitted: (val) {
34 | Utils.toast("searching $val");
35 | },
36 | onCancel: () {
37 | Utils.toast("canceled");
38 | },
39 | ),
40 | title(I18n.of(context)!.custom_style),
41 | Search(
42 | shape: "round",
43 | background: Color(0xfff2f3DA),
44 | showAction: true,
45 | maxLength: 16,
46 | placeholder: I18n.of(context)!.placeholder_input,
47 | ),
48 | title(I18n.of(context)!.custom_button_text),
49 | Search(
50 | showAction: true,
51 | left: Row(
52 | children: [
53 | Text(I18n.of(context)!.address),
54 | SizedBox(width: 6),
55 | GestureDetector(
56 | child: Icon(_icon, color: _color, size: 18),
57 | onTap: () {
58 | setState(() {
59 | _icon = Icons.star;
60 | _color = Colors.orangeAccent;
61 | });
62 | },
63 | )
64 | ],
65 | ),
66 | rightIcon: Icons.search,
67 | onClickRight: () {
68 | Utils.toast("clicked Right Icon");
69 | },
70 | right: Row(
71 | children: [
72 | GestureDetector(
73 | onTap: () {
74 | Utils.toast("clicked Right");
75 | },
76 | child: Text(I18n.of(context)!.search),
77 | ),
78 | SizedBox(width: 4),
79 | Text(I18n.of(context)!.collect)
80 | ],
81 | ),
82 | )
83 | ]));
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/example/lib/routes/demoSidebar.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_vant_kit/main.dart';
4 |
5 | class DemoSidebar extends StatefulWidget {
6 | @override
7 | _DemoSidebar createState() => _DemoSidebar();
8 | }
9 |
10 | class _DemoSidebar extends State {
11 | String? _status = "New";
12 | int _active = 0;
13 |
14 | Widget title(String title) {
15 | return Padding(
16 | padding: EdgeInsets.symmetric(vertical: 20),
17 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
18 | );
19 | }
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | List list1 = [
24 | SideBarItem(title: I18n.of(context)!.tag),
25 | SideBarItem(title: I18n.of(context)!.tag),
26 | SideBarItem(title: I18n.of(context)!.tag),
27 | ];
28 |
29 | List list2 = [
30 | SideBarItem(title: I18n.of(context)!.tag, dot: true),
31 | SideBarItem(title: I18n.of(context)!.tag, info: "5"),
32 | SideBarItem(
33 | title: I18n.of(context)!.tag,
34 | info: _status,
35 | onClick: (val) {
36 | setState(() {
37 | _status = null;
38 | _active = val;
39 | });
40 | }),
41 | ];
42 |
43 | List list3 = [
44 | SideBarItem(title: I18n.of(context)!.tag),
45 | SideBarItem(title: I18n.of(context)!.tag, disabled: true),
46 | SideBarItem(title: I18n.of(context)!.tag),
47 | ];
48 | return SingleChildScrollView(
49 | child: Wrap(
50 | spacing: 100,
51 | runSpacing: 30,
52 | children: [
53 | Column(
54 | crossAxisAlignment: CrossAxisAlignment.start,
55 | children: [
56 | title(I18n.of(context)!.basic_usage),
57 | Sidebar(
58 | list: list1,
59 | )
60 | ]),
61 | Column(
62 | crossAxisAlignment: CrossAxisAlignment.start,
63 | children: [
64 | title(I18n.of(context)!.tip),
65 | Sidebar(
66 | active: _active,
67 | list: list2,
68 | )
69 | ]),
70 | Column(
71 | crossAxisAlignment: CrossAxisAlignment.start,
72 | children: [
73 | title(I18n.of(context)!.disabled_options),
74 | Sidebar(
75 | list: list3,
76 | )
77 | ]),
78 | ],
79 | ),
80 | );
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/example/lib/routes/demoSkeleton.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoSkeleton extends StatefulWidget {
7 | @override
8 | _DemoSkeleton createState() => _DemoSkeleton();
9 | }
10 |
11 | class _DemoSkeleton extends State {
12 | bool _loading = true;
13 |
14 | Widget title(String title) {
15 | return Padding(
16 | padding: EdgeInsets.fromLTRB(0, 30, 0, 20),
17 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
18 | );
19 | }
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | return SingleChildScrollView(
24 | child: Column(
25 | crossAxisAlignment: CrossAxisAlignment.start,
26 | children: [
27 | title(I18n.of(context)!.basic_usage),
28 | Skeleton(
29 | row: 3,
30 | title: true,
31 | ),
32 | title(I18n.of(context)!.show_avatar),
33 | Skeleton(
34 | row: 3,
35 | title: true,
36 | avatar: true,
37 | avatarShape: "round",
38 | ),
39 | title(I18n.of(context)!.show_sub_components),
40 | CupertinoSwitch(
41 | value: _loading,
42 | onChanged: (value) {
43 | setState(() {
44 | _loading = value;
45 | });
46 | },
47 | ),
48 | SizedBox(height: 6),
49 | Skeleton(
50 | row: 3,
51 | title: true,
52 | avatarShape: "round",
53 | loading: !_loading,
54 | child: Column(
55 | crossAxisAlignment: CrossAxisAlignment.start,
56 | children: [
57 | Text(I18n.of(context)!.about_vant,
58 | style:
59 | TextStyle(fontWeight: FontWeight.bold, fontSize: 16)),
60 | SizedBox(
61 | height: 10,
62 | ),
63 | Text(I18n.of(context)!.example_skeletion,
64 | style: TextStyle(fontSize: 14, height: 1.5))
65 | ],
66 | ),
67 | )
68 | ]));
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/example/lib/routes/demoSubmitBar.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/generated/i18n.dart';
2 | import 'package:flutter/material.dart';
3 | import '../utils/index.dart';
4 | import 'package:flutter_vant_kit/main.dart';
5 |
6 | class DemoSubmitBar extends StatefulWidget {
7 | @override
8 | _DemoSubmitBar createState() => _DemoSubmitBar();
9 | }
10 |
11 | class _DemoSubmitBar extends State {
12 | Widget title(String title) {
13 | return Padding(
14 | padding: EdgeInsets.symmetric(vertical: 20, horizontal: 20),
15 | child: Text(title, style: TextStyle(fontSize: 14, color: Colors.grey)),
16 | );
17 | }
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return SingleChildScrollView(
22 | child: Column(
23 | crossAxisAlignment: CrossAxisAlignment.start,
24 | children: [
25 | title(I18n.of(context)!.basic_usage),
26 | SubmitBar(buttonText: I18n.of(context)!.submit_orders, price: 30.50),
27 | title(I18n.of(context)!.disabled_status),
28 | SubmitBar(
29 | buttonText: I18n.of(context)!.submit_orders,
30 | price: 30.50,
31 | tip: I18n.of(context)!.address_tip,
32 | tipIcon: Icons.error_outline,
33 | disabled: true,
34 | ),
35 | title(I18n.of(context)!.loading_status),
36 | SubmitBar(
37 | buttonText: I18n.of(context)!.submit_orders,
38 | price: 30.50,
39 | loading: true,
40 | ),
41 | title(I18n.of(context)!.advanced_usage),
42 | SubmitBar(
43 | buttonText: I18n.of(context)!.submit_orders,
44 | price: 30.50,
45 | tip: I18n.of(context)!.address_tip,
46 | customTip: GestureDetector(
47 | onTap: () {
48 | Utils.toast("Clicked Tip");
49 | },
50 | child: Text(I18n.of(context)!.change_address,
51 | style: TextStyle(fontSize: 12, color: Colors.blueAccent)),
52 | ),
53 | customLeft:
54 | NCheckbox(text: I18n.of(context)!.select_all, value: true),
55 | ),
56 | ]));
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/example/lib/routes/index.dart:
--------------------------------------------------------------------------------
1 | export 'demoField.dart';
2 | export 'demoTag.dart';
3 | export 'demoRate.dart';
4 | export 'demoSwipe.dart';
5 | export 'demoProgress.dart';
6 | export 'demoPanel.dart';
7 | export 'demoCell.dart';
8 | export 'demoStepper.dart';
9 | export 'demoImageWall.dart';
10 | export 'demoBadge.dart';
11 | export 'demoNoticeBar.dart';
12 | export 'demoButton.dart';
13 | export 'demoDivider.dart';
14 | export 'demoCircle.dart';
15 | export 'demoSearch.dart';
16 | export 'demoDialog.dart';
17 | export 'demoImage.dart';
18 | export 'demoNumberKeyboard.dart';
19 | export 'demoPasswordInput.dart';
20 | export 'demoImagePreview.dart';
21 | export 'demoSteps.dart';
22 | export 'demoPagination.dart';
23 | export 'demoList.dart';
24 | export 'demoActionSheet.dart';
25 | export 'demoSkeleton.dart';
26 | export 'demoSidebar.dart';
27 | export 'demoTreeSelect.dart';
28 | export 'demoAddressEdit.dart';
29 | export 'demoAddressList.dart';
30 | export 'demoLoading.dart';
31 | export 'demoCheckbox.dart';
32 | export 'demoRadio.dart';
33 | export 'demoCard.dart';
34 | export 'demoGoodsAction.dart';
35 | export 'demoSubmitBar.dart';
36 | export 'demoCoupon.dart';
37 | export 'demoPrice.dart';
38 | export 'demoAvatar.dart';
39 | export 'demoCollapse.dart';
40 | export 'demoCalendar.dart';
41 | export 'demoPicker.dart';
42 | export 'demoContactCard.dart';
43 | export 'demoShareSheet.dart';
44 |
--------------------------------------------------------------------------------
/example/lib/utils/index.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:fluttertoast/fluttertoast.dart';
3 |
4 | class Utils {
5 | static toast(String msg) {
6 | Fluttertoast.showToast(
7 | msg: msg,
8 | gravity: ToastGravity.CENTER,
9 | backgroundColor: Colors.black87);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/imgs/addressList.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/addressList.gif
--------------------------------------------------------------------------------
/imgs/button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/button.gif
--------------------------------------------------------------------------------
/imgs/cell.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/cell.gif
--------------------------------------------------------------------------------
/imgs/field.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/field.gif
--------------------------------------------------------------------------------
/imgs/imageWall.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/imageWall.gif
--------------------------------------------------------------------------------
/imgs/passwordInput.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/passwordInput.gif
--------------------------------------------------------------------------------
/imgs/steps.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/steps.gif
--------------------------------------------------------------------------------
/imgs/treeSelect.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/benjaken/flutter_vant_kit/82021bc7732b548d6ea9b6aee6dfb8803a573139/imgs/treeSelect.gif
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | library flutter_vant_kit;
2 |
3 | export 'widgets/actionSheet.dart';
4 | export 'widgets/addressEdit.dart';
5 | export 'widgets/addressList.dart';
6 | export 'widgets/avatar.dart';
7 | export 'widgets/badge.dart';
8 | export 'widgets/button.dart';
9 | export 'widgets/card.dart';
10 | export 'widgets/cell.dart';
11 | export 'widgets/cellGroup.dart';
12 | export 'widgets/checkbox.dart';
13 | export 'widgets/checkboxGroup.dart';
14 | export 'widgets/collapse.dart';
15 | export 'widgets/collapseItem.dart';
16 | export 'widgets/coupon.dart';
17 | export 'widgets/dialog.dart';
18 | export 'widgets/divider.dart';
19 | export 'widgets/field.dart';
20 | export 'widgets/goodsAction.dart';
21 | export 'widgets/imagePreview.dart';
22 | export 'widgets/imageWall.dart';
23 | export 'widgets/list.dart';
24 | export 'widgets/loading.dart';
25 | export 'widgets/noticeBar.dart';
26 | export 'widgets/numberKeyboard.dart';
27 | export 'widgets/pagination.dart';
28 | export 'widgets/panel.dart';
29 | export 'widgets/passwordInput.dart';
30 | export 'widgets/price.dart';
31 | export 'widgets/progress.dart';
32 | export 'widgets/radioGroup.dart';
33 | export 'widgets/rate.dart';
34 | export 'widgets/search.dart';
35 | export 'widgets/sidebar.dart';
36 | export 'widgets/skeleton.dart';
37 | export 'widgets/stepper.dart';
38 | export 'widgets/steps.dart';
39 | export 'widgets/submitBar.dart';
40 | export 'widgets/swipe.dart';
41 | export 'widgets/tag.dart';
42 | export 'widgets/treeSelect.dart';
43 | export 'widgets/calendar.dart';
44 | export 'widgets/picker.dart';
45 | export 'widgets/picker.dart';
46 | export 'widgets/contactCard.dart';
47 | export 'widgets/shareSheet.dart';
48 |
--------------------------------------------------------------------------------
/lib/widgets/avatar.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_vant_kit/theme/style.dart';
3 |
4 | class Avatar extends StatelessWidget {
5 | // 头像类型
6 | final String type;
7 | // 头像大小
8 | final double? size;
9 | // 头像形状
10 | final String shape;
11 | // 头像背景颜色
12 | final Color? color;
13 | // 头像图标颜色
14 | final Color? iconColor;
15 | // 自定义图标内容
16 | final Widget? custom;
17 | // 头像图片内容
18 | final ImageProvider? image;
19 | // 点击头像后回调
20 | final Function()? onClick;
21 |
22 | Avatar(
23 | {Key? key,
24 | this.type: 'normal',
25 | this.size,
26 | this.shape: 'round',
27 | this.color,
28 | this.iconColor,
29 | this.custom,
30 | this.image,
31 | this.onClick})
32 | : assert(["small", "normal", "large"].indexOf(type) > -1,
33 | "type must be small, normal, or large"),
34 | assert(["round", "square"].indexOf(shape) > -1,
35 | "shape must be round, or square"),
36 | super(key: key);
37 |
38 | final Map defaultSize = {
39 | "small": Style.avatarWidthSm,
40 | "normal": Style.avatarWidthBase,
41 | "large": Style.avatarWidthLg,
42 | };
43 |
44 | @override
45 | Widget build(BuildContext context) {
46 | return GestureDetector(
47 | onTap: () {
48 | if (onClick != null) onClick!();
49 | },
50 | child: Container(
51 | width: size ?? defaultSize[type]! * 1.5,
52 | height: size ?? defaultSize[type]! * 1.5,
53 | decoration: BoxDecoration(
54 | color: color ?? Style.avatarBackgroundColor,
55 | borderRadius: BorderRadius.circular(shape == 'square'
56 | ? Style.avatarBorderRaidus
57 | : Style.avatarRoundBorderRaidus)),
58 | child: image != null
59 | ? CircleAvatar(
60 | backgroundImage: image,
61 | )
62 | : Center(
63 | child: custom ??
64 | Icon(Icons.perm_identity,
65 | color: iconColor ?? Style.avatarIconColor,
66 | size: size ?? defaultSize[type]),
67 | ),
68 | ),
69 | );
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/lib/widgets/cellGroup.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_vant_kit/theme/style.dart';
3 | import 'package:flutter_vant_kit/widgets/divider.dart';
4 |
5 | class CellGroup extends StatelessWidget {
6 | // 分组标题
7 | final String? title;
8 | // 是否显示外边框
9 | final bool border;
10 | // 自定义边框样式
11 | final BoxDecoration? decoration;
12 | // 默认插槽
13 | final List? children;
14 |
15 | CellGroup(
16 | {Key? key, this.title, this.children, this.border: true, this.decoration})
17 | : super(key: key);
18 |
19 | buildItems(List list) {
20 | List widgets = [];
21 | for (int i = 0; i < list.length; i++) {
22 | widgets.add(list[i]);
23 | if (i < list.length - 1)
24 | widgets.add(Container(
25 | margin: EdgeInsets.symmetric(horizontal: Style.cellHorizontalPadding),
26 | child: NDivider(),
27 | ));
28 | }
29 | return widgets;
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | return Column(
35 | crossAxisAlignment: CrossAxisAlignment.start,
36 | children: [
37 | title != null
38 | ? Padding(
39 | padding: Style.cellGroupTitlePadding,
40 | child: Text(title!,
41 | style: TextStyle(
42 | fontSize: Style.cellGroupTitleFontSize,
43 | color: Colors.grey)),
44 | )
45 | : Container(),
46 | Container(
47 | decoration: decoration ??
48 | BoxDecoration(
49 | border: border
50 | ? Border(
51 | top: BorderSide(
52 | width: Style.borderWidthBase,
53 | color: Style.cellBorderColor),
54 | bottom: BorderSide(
55 | width: Style.borderWidthBase,
56 | color: Style.cellBorderColor),
57 | )
58 | : null,
59 | color: Colors.white),
60 | child: Column(
61 | children: buildItems(children!),
62 | ),
63 | )
64 | ],
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/widgets/collapse.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_vant_kit/theme/style.dart';
3 | import 'package:flutter_vant_kit/widgets/collapseItem.dart';
4 | import 'package:flutter_vant_kit/widgets/divider.dart';
5 |
6 | class Collapse extends StatefulWidget {
7 | // 当前展开面板的 name
8 | final List? name;
9 | // 子面板
10 | final List list;
11 | // 是否为手风琴
12 | final bool accordion;
13 | // 是否显示外边框
14 | final bool border;
15 | // 切换面板时触发
16 | final Function(List?)? onChange;
17 |
18 | Collapse(
19 | {Key? key,
20 | this.name,
21 | required this.list,
22 | this.accordion: false,
23 | this.border: true,
24 | this.onChange})
25 | : super(key: key);
26 |
27 | @override
28 | _Collapse createState() => _Collapse();
29 | }
30 |
31 | class _Collapse extends State {
32 | List? _name;
33 |
34 | @override
35 | void initState() {
36 | super.initState();
37 | _name = widget.name ?? [];
38 | }
39 |
40 | List buildItems() {
41 | List widgets = [];
42 | for (int i = 0; i < widget.list.length; i++) {
43 | CollapseItem item = widget.list[i];
44 | String name = item.name ?? i.toString();
45 | widgets.add(CollapseItem(
46 | name: name,
47 | title: item.title,
48 | customTitle: item.customTitle,
49 | icon: item.icon,
50 | value: item.value,
51 | label: item.label,
52 | customLabel: item.customLabel,
53 | clickable: item.clickable,
54 | isExpanded: _name!.contains(name),
55 | content: item.content,
56 | child: item.child,
57 | rightIcon: item.rightIcon,
58 | onExpansionChanged: (val) {
59 | setState(() {
60 | if (widget.accordion) _name = [];
61 | val ? _name!.add(name) : _name!.remove(name);
62 | });
63 | if (widget.onChange != null) widget.onChange!(_name);
64 | },
65 | ));
66 | if (i < widget.list.length - 1) widgets.add(NDivider());
67 | }
68 | return widgets;
69 | }
70 |
71 | @override
72 | Widget build(BuildContext context) {
73 | return SingleChildScrollView(
74 | child: Container(
75 | decoration: BoxDecoration(
76 | border: Border(
77 | top: BorderSide(
78 | width: widget.border ? Style.borderWidthBase : 0,
79 | color: Style.borderColor),
80 | bottom: BorderSide(
81 | width: widget.border ? Style.borderWidthBase : 0,
82 | color: Style.borderColor),
83 | )),
84 | child: Column(
85 | children: buildItems(),
86 | ),
87 | ),
88 | );
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/lib/widgets/loading.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_vant_kit/theme/style.dart';
3 |
4 | class Loading extends StatelessWidget {
5 | // 加载描述
6 | final String? text;
7 | // 加载环颜色
8 | final Color? color;
9 | // 加载环大小
10 | final double size;
11 | // 加载描述字体大小
12 | final double textSize;
13 | // 加载条排列方式
14 | final bool vertical;
15 | // 自定义内容
16 | final Widget? loading;
17 |
18 | const Loading(
19 | {Key? key,
20 | this.text,
21 | this.color,
22 | this.size: Style.loadingSpinnerSize,
23 | this.textSize: Style.loadingTextFontSize,
24 | this.vertical: false,
25 | this.loading})
26 | : super(key: key);
27 |
28 | _buildLoading() {
29 | return SizedBox(
30 | width: size,
31 | height: size,
32 | child: loading ??
33 | CircularProgressIndicator(
34 | valueColor:
35 | AlwaysStoppedAnimation(color ?? Style.loadingSpinnerColor),
36 | backgroundColor: Style.transparent,
37 | strokeWidth: Style.loadingSpinnerWidth,
38 | ),
39 | );
40 | }
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | return DecoratedBox(
45 | decoration: BoxDecoration(color: Colors.transparent),
46 | child: vertical
47 | ? Column(
48 | mainAxisSize: MainAxisSize.min,
49 | children: [
50 | _buildLoading(),
51 | text != null
52 | ? Padding(
53 | padding: EdgeInsets.only(top: Style.intervalSm),
54 | child: Text("$text",
55 | style: TextStyle(
56 | color: Style.loadingTextColor,
57 | fontSize: textSize,
58 | decoration: TextDecoration.none)),
59 | )
60 | : Container()
61 | ],
62 | )
63 | : Row(
64 | mainAxisSize: MainAxisSize.min,
65 | children: [
66 | _buildLoading(),
67 | text != null
68 | ? Padding(
69 | padding: EdgeInsets.only(left: Style.intervalXl),
70 | child: Text("$text",
71 | style: TextStyle(
72 | color: Style.loadingTextColor,
73 | fontSize: textSize,
74 | decoration: TextDecoration.none)),
75 | )
76 | : Container()
77 | ],
78 | ),
79 | );
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/lib/widgets/price.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_vant_kit/theme/style.dart';
3 |
4 | class Price extends StatelessWidget {
5 | // 价格
6 | final double? value;
7 | // 价格颜色
8 | final Color color;
9 | // 价格大小
10 | final double size;
11 | // 货币符号
12 | final String currency;
13 | // 保留的小数点
14 | final int decimal;
15 | // 是否按照千分号形式显示
16 | final bool thousands;
17 |
18 | const Price(
19 | {Key? key,
20 | this.currency: "¥",
21 | this.size: Style.priceFontSize,
22 | required this.value,
23 | this.color: Style.priceTextColor,
24 | this.decimal: 2,
25 | this.thousands: false})
26 | : super(key: key);
27 |
28 | @override
29 | Widget build(BuildContext context) {
30 | String integer = value!.toInt().toString();
31 | RegExp reg = new RegExp(r"(\d)((?:\d{3})+\b)");
32 | if (thousands)
33 | while (reg.hasMatch(integer)) {
34 | integer = integer.replaceAllMapped(
35 | reg, (match) => "${match.group(1)},${match.group(2)}");
36 | }
37 | String decimalString = value!.toStringAsFixed(decimal).split('.')[1];
38 | return Row(
39 | textBaseline: TextBaseline.ideographic,
40 | crossAxisAlignment: CrossAxisAlignment.baseline,
41 | children: [
42 | Text("$currency",
43 | style: TextStyle(fontSize: (size / 1.5).toDouble(), color: color)),
44 | Text("$integer",
45 | style: TextStyle(
46 | fontSize: size,
47 | color: color,
48 | fontWeight: Style.priceIntegetFontWeight)),
49 | Text(".$decimalString",
50 | style: TextStyle(fontSize: (size / 1.5).toDouble(), color: color))
51 | ],
52 | );
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/lib/widgets/rate.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter/widgets.dart';
3 | import 'package:flutter_vant_kit/theme/style.dart';
4 |
5 | //星级评分
6 | class Rate extends StatefulWidget {
7 | // 图标总数
8 | final int count;
9 | // 当前分值
10 | final int value;
11 | // 图标大小
12 | final double size;
13 | // 图标间距
14 | final double gutter;
15 | // 自定义图标
16 | final IconData icon;
17 | // 自定义未选中图标
18 | final IconData voidIcon;
19 | // 选中颜色
20 | final Color color;
21 | // 未选中颜色
22 | final Color voidColor;
23 | // 是否为只读状态
24 | final bool readonly;
25 | // 是否为禁用状态
26 | final bool disabled;
27 | // 当前分值变化时触发的事件
28 | final Function(String val)? onChange;
29 |
30 | Rate({
31 | Key? key,
32 | this.count: 5,
33 | required this.value,
34 | this.size: Style.rateIconSize,
35 | this.gutter: Style.rateHorizontalGutter,
36 | this.icon: Icons.star,
37 | this.voidIcon: Icons.star_border,
38 | this.color: Style.rateActiveColor,
39 | this.voidColor: Style.rateInactiveColor,
40 | this.readonly: false,
41 | this.disabled: false,
42 | this.onChange,
43 | }) : assert(count > 1 && value >= 1, 'count 或 value 不能小于1'),
44 | super(key: key);
45 |
46 | @override
47 | _Rate createState() => _Rate();
48 | }
49 |
50 | class _Rate extends State {
51 | late int _starNum;
52 |
53 | @override
54 | void initState() {
55 | super.initState();
56 | _starNum = widget.value;
57 | }
58 |
59 | @override
60 | Widget build(BuildContext context) {
61 | return Container(
62 | child: Wrap(
63 | children: _buildChildren(),
64 | spacing: widget.gutter,
65 | ),
66 | );
67 | }
68 |
69 | List _buildChildren() {
70 | List widgets = [];
71 | for (int i = 1; i <= widget.count; i++) {
72 | Widget item = Container(
73 | child: GestureDetector(
74 | child: Icon(
75 | _starNum >= i ? widget.icon : widget.voidIcon,
76 | color: _starNum >= i
77 | ? widget.disabled
78 | ? Style.rateDisabledColor
79 | : widget.color
80 | : widget.voidColor,
81 | size: widget.size,
82 | ),
83 | onTap: widget.readonly || widget.disabled
84 | ? null
85 | : () {
86 | setState(() {
87 | _starNum = i;
88 | });
89 | if (widget.onChange != null)
90 | widget.onChange!(_starNum.toString());
91 | }),
92 | );
93 | widgets.add(item);
94 | }
95 | return widgets;
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_vant_kit
2 | description: A vant-style flutter UI library.You can use this library to quickly build your application.
3 |
4 | version: 0.3.0
5 | homepage: https://github.com/benjaken/flutter_vant_kit
6 |
7 | environment:
8 | sdk: '>=2.12.0 <3.0.0'
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 | multi_image_picker: ^4.8.0
14 |
15 | dev_dependencies:
16 | flutter_test:
17 | sdk: flutter
18 |
19 | flutter:
20 | uses-material-design: true
--------------------------------------------------------------------------------