File tree Expand file tree Collapse file tree 6 files changed +147
-40
lines changed Expand file tree Collapse file tree 6 files changed +147
-40
lines changed Original file line number Diff line number Diff line change 1+ ## ** Slider**
2+
3+ >
4+ Silder用来选择连续性的或者非连续性的数据
5+
6+ ### 构造方法
7+ ``` dart
8+ Slider({
9+ Key key,
10+ @required this.value,
11+ @required this.onChanged,
12+ this.onChangeStart,
13+ this.onChangeEnd,
14+ this.min = 0.0,
15+ this.max = 1.0,
16+ this.divisions,
17+ this.label,
18+ this.activeColor,
19+ this.inactiveColor,
20+ this.semanticFormatterCallback,
21+ })
22+ ```
23+
24+ ### 属性介绍
25+ * value:Silder当前值
26+ * onChanged:滑块状态发生变化时进行回调
27+ * onChangeStart:滑块状态刚发生变化时的回调
28+ * onChangeEnd:滑块状态变化结束时的回调
29+ * min:用户可以选择的最小值
30+ * max:用户可以选择的最大值
31+ * divisions:将silder划分为几份
32+ * label:滑块处于活动状态时显示在滑块上方的标签
33+ * activeColor:用于滑块轨道中活动部分的颜色
34+ * inactiveColor:滑块轨道的非活动部分的颜色
35+
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import 'radio/index.dart' as radio;
99import 'formfield/index.dart' as formfield;
1010import 'form/index.dart' as form;
1111import 'daypicker/index.dart' as daypicker;
12+ import 'slider/index.dart' as Slider;
1213
1314const nameSpaces = '/form_' ;
1415
@@ -23,6 +24,11 @@ List widgets = [
2324 code: 59662 , // gavel
2425 title: CheckboxListTile .Index .title
2526 ),
27+ ItemInfo (
28+ widget: Slider .Index (),
29+ code: 59662 , // gavel
30+ title: Slider .Index .title
31+ ),
2632 ItemInfo (
2733 widget: daypicker.Index (),
2834 code: 59662 , // gavel
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+
3+
4+ class Index extends StatefulWidget {
5+ @override
6+ _IndexState createState () => _IndexState ();
7+ }
8+
9+ class _IndexState extends State <Index > {
10+ double _sliderValue = 0.0 ;
11+
12+ @override
13+ Widget build (BuildContext context) {
14+ return Scaffold (
15+ appBar: AppBar (title: Text ('Slider' ),),
16+ body: Center (
17+ child: Slider (
18+ value: _sliderValue,
19+ onChanged: (value){
20+ setState (() {
21+ _sliderValue = value;
22+ });
23+ },
24+ onChangeStart: (value){
25+ print ('onChangeStart:$value ' );
26+ },
27+ onChangeEnd: (value) {
28+ print ('onChangeEnd:$value ' );
29+ },
30+ min: 0.0 ,
31+ max: 100.0 ,
32+ activeColor: Theme .of (context).primaryColor,
33+ inactiveColor: Theme .of (context).primaryColor.withOpacity (0.3 ),
34+ divisions: 10 ,
35+ label: '${_sliderValue .toInt ()}' ,
36+ ),
37+ ),
38+ );
39+ }
40+ }
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+ import 'package:efox_flutter/components/widgetComp.dart' as WidgetComp;
3+ import 'demo.dart' as Demo;
4+
5+ class Index extends StatefulWidget {
6+ static String title = 'Slider' ;
7+ static String originCodeUrl = 'https://docs.flutter.io/flutter/material/Slider-class.html' ;
8+ static String mdUrl = 'docs/widget/form/slider/index.md' ;
9+ @override
10+ _IndexState createState () => _IndexState ();
11+ }
12+
13+ class _IndexState extends State <Index > {
14+ @override
15+ Widget build (BuildContext context) {
16+ return WidgetComp .Index (
17+ title: Index .title,
18+ originCodeUrl: Index .originCodeUrl,
19+ mdUrl: Index .mdUrl,
20+ demoChild: < Widget > [
21+ Demo .Index ()
22+ ],
23+ );
24+ }
25+ }
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ flutter:
9696 - docs/widget/form/switch/
9797 - docs/widget/form/textfield/
9898 - docs/widget/form/textinput/
99+ - docs/widget/form/slider/
99100 - docs/widget/navigator/appbar/
100101 - docs/widget/navigator/scaffold/
101102 - docs/widget/navigator/bottomnavigationbar/
Original file line number Diff line number Diff line change 3030——locale
3131```
3232
33- # 组件进度列表
34- ### animate
35- ```
36- 1. animatedbuilder【】
37- 2. animatedcontainer【】
38- 3. animatedcrossfade【】
39- 4. animateddefaulttextstyle【】
40- 5. animatedliststate【】
41- 6. animatedmodalbarrier【】
42- 7. animatedopacity【】
43- 8. animatedphysicalmodel【】
44- 9. animatedpositioned【】
45- 10. animatedsize【】
46- 11. animatedwidget【】
47- 12. animatedwidgetbasestate【】
48- 13. animationcontroller【】
49- 14. decoratedboxtransition【】
50- 15. fadetransition【】
51- 16. hero【】
52- 17. positionedtransition【】
53- 18. rotationtransition【】
54- 19. scaletransition【】
55- 20. sizetransition【】
56- 20. slidetransition【】
57- ```
33+ ## 组件进度列表
34+ - animate
35+ 1 . animationController【✔️ v1.0】
36+ 2 . animatedbuilder【】
37+ 3 . animatedcontainer【】
38+ 4 . animatedcrossfade【】
39+ 5 . animateddefaulttextstyle【】
40+ 6 . animatedliststate【】
41+ 7 . animatedmodalbarrier【】
42+ 8 . animatedopacity【】
43+ 9 . animatedphysicalmodel【】
44+ 10 . animatedpositioned【】
45+ 11 . animatedsize【】
46+ 12 . animatedwidget【】
47+ 13 . animatedwidgetbasestate【】
48+ 14 . animationcontroller【】
49+ 15 . decoratedboxtransition【】
50+ 16 . fadetransition【】
51+ 17 . hero【】
52+ 18 . positionedtransition【】
53+ 19 . rotationtransition【】
54+ 20 . scaletransition【】
55+ 21 . sizetransition【】
56+ 22 . slidetransition【】
5857
59- ### bulletbox
60- ```
58+
59+ - bulletbox
61601 . alertdialog【✔️ v1.0】
62612 . bottomsheet【✔️ v1.0】
63623 . expansionPanel【✔️ v1.0】
71702 . buttonbar【】
72713 . chip【】
73724 . container【✔️ v1.0】
74- 5. divider【】
75- 6. flatbutton【】
73+ 5 . divider【✔️ v1.0 】
74+ 6 . flatbutton【✔️ v1.0 】
76757 . icon【】
77768 . iconbutton【】
78779 . image【】
818012 . raisedbutton【】
828113 . rawimage【】
838214 . stepper【】
84- 15. text【】
83+ 15 . text【✔️ v1.0 】
858416 . tooltip【】
8685```
8786
8887### form
8988```
90891 . checkbox【✔️ v1.0】
91902 . checkboxlisttile【✔️ v1.0】
92- 3.【daypicker】
93- 4.【form】
94- 5.【formfield】
95- 6.【radio】
96- 7.【rawkeyboard】
97- 8.【switch】
98- 9.【textfield】
99- 10.【textinput】
100- 11.【】
101- 12.【】
91+ 3 . slider【✔️ v1.0】
92+ 3 . daypicker【】
93+ 4 . form【】
94+ 5 . formfield【】
95+ 6 . radio【】
96+ 7 . rawkeyboard【】
97+ 8 . switch【】
98+ 9 . textfield【】
99+ 10 . textinput【】
100+ 11 . 【】
101+ 12 . 【】
102102```
103103
104104### gestures
You can’t perform that action at this time.
0 commit comments