Skip to content

Commit

Permalink
docs(switch/slider/toast/touchable): add some example
Browse files Browse the repository at this point in the history
  • Loading branch information
2534290808 committed Mar 8, 2019
1 parent 99b3cfd commit db827ef
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ To use this plugin, add `flutter_weui` as a [dependency in your pubspec.yaml fil
- [`Panel`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/panel_example.dart)
- [`Picker`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/picker_example.dart)
- [`Slider`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`Switch`]()
- [`Toast`]()
- [`TouchableHighlight`]()
- [`TouchableOpacity`]()
- [`Switch`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`Toast`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`TouchableHighlight`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`TouchableOpacity`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)

8 changes: 4 additions & 4 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- [`Panel`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/panel_example.dart)
- [`Picker`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/picker_example.dart)
- [`Slider`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`Switch`]()
- [`Toast`]()
- [`TouchableHighlight`]()
- [`TouchableOpacity`]()
- [`Switch`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`Toast`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`TouchableHighlight`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
- [`TouchableOpacity`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/slider_example.dart)
43 changes: 39 additions & 4 deletions example/lib/slider_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,48 @@ class SliderExample extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Slider"),
title: Text("Slider、Switch、Toast、Touchable"),
),
body: Center(
child:Column(
child: Column(
children: <Widget>[
WSlider(),
WSlider(showValue: true,)
WSlider(
onChanged: (value) {},
),
WSlider(
showValue: true,
onChanged: (value) {},
),
WSwitch(
onChanged: (value) {},
),
FlatButton(
onPressed: () {
Toast.success(context, "success");
},
child: Text("Toast_success")),
FlatButton(
onPressed: () {
Toast.loading(context, "loading");
Future.delayed(const Duration(seconds: 1), () {
Toast.close(context);
});
},
child: Text("Toast_loading")),
TouchableHighlight(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15,horizontal: 10),
child: Text("TouchableHightlight"),
),
onPressed: () {},
),
TouchableOpacity(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15,horizontal: 10),
child: Text("TouchableOpacity"),
),
onPressed: () {},
)
],
),
),
Expand Down

0 comments on commit db827ef

Please sign in to comment.