Skip to content

Commit db827ef

Browse files
committed
docs(switch/slider/toast/touchable): add some example
1 parent 99b3cfd commit db827ef

File tree

3 files changed

+47
-12
lines changed

3 files changed

+47
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ To use this plugin, add `flutter_weui` as a [dependency in your pubspec.yaml fil
2323
- [`Panel`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/panel_example.dart)
2424
- [`Picker`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/picker_example.dart)
2525
- [`Slider`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
26-
- [`Switch`]()
27-
- [`Toast`]()
28-
- [`TouchableHighlight`]()
29-
- [`TouchableOpacity`]()
26+
- [`Switch`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
27+
- [`Toast`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
28+
- [`TouchableHighlight`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
29+
- [`TouchableOpacity`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
3030

README_zh-CN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
- [`Panel`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/panel_example.dart)
2424
- [`Picker`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/picker_example.dart)
2525
- [`Slider`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
26-
- [`Switch`]()
27-
- [`Toast`]()
28-
- [`TouchableHighlight`]()
29-
- [`TouchableOpacity`]()
26+
- [`Switch`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
27+
- [`Toast`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
28+
- [`TouchableHighlight`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
29+
- [`TouchableOpacity`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)

example/lib/slider_example.dart

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,48 @@ class SliderExample extends StatelessWidget {
66
Widget build(BuildContext context) {
77
return Scaffold(
88
appBar: AppBar(
9-
title: Text("Slider"),
9+
title: Text("Slider、Switch、Toast、Touchable"),
1010
),
1111
body: Center(
12-
child:Column(
12+
child: Column(
1313
children: <Widget>[
14-
WSlider(),
15-
WSlider(showValue: true,)
14+
WSlider(
15+
onChanged: (value) {},
16+
),
17+
WSlider(
18+
showValue: true,
19+
onChanged: (value) {},
20+
),
21+
WSwitch(
22+
onChanged: (value) {},
23+
),
24+
FlatButton(
25+
onPressed: () {
26+
Toast.success(context, "success");
27+
},
28+
child: Text("Toast_success")),
29+
FlatButton(
30+
onPressed: () {
31+
Toast.loading(context, "loading");
32+
Future.delayed(const Duration(seconds: 1), () {
33+
Toast.close(context);
34+
});
35+
},
36+
child: Text("Toast_loading")),
37+
TouchableHighlight(
38+
child: Padding(
39+
padding: const EdgeInsets.symmetric(vertical: 15,horizontal: 10),
40+
child: Text("TouchableHightlight"),
41+
),
42+
onPressed: () {},
43+
),
44+
TouchableOpacity(
45+
child: Padding(
46+
padding: const EdgeInsets.symmetric(vertical: 15,horizontal: 10),
47+
child: Text("TouchableOpacity"),
48+
),
49+
onPressed: () {},
50+
)
1651
],
1752
),
1853
),

0 commit comments

Comments
 (0)