Skip to content

Commit 68463dd

Browse files
committed
docs(dialog): add dialog example
1 parent 848cb67 commit 68463dd

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To use this plugin, add `flutter_weui` as a [dependency in your pubspec.yaml fil
1616
- [`ActionSheet`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/action_sheet_example.dart)
1717
- [`Article`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/article_example.dart)
1818
- [`Cell`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/cell_example.dart)
19-
- [`Dialog`]()
19+
- [`Dialog`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/dialog_example.dart)
2020
- [`Footer`]()
2121
- [`LoadMore`]()
2222
- [`MediaBox`]()

README_zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- [`ActionSheet`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/action_sheet_example.dart)
1717
- [`Article`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/article_example.dart)
1818
- [`Cell`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/cell_example.dart)
19-
- [`Dialog`]()
19+
- [`Dialog`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/dialog_example.dart)
2020
- [`Footer`]()
2121
- [`LoadMore`]()
2222
- [`MediaBox`]()

example/lib/dialog_example.dart

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_weui/flutter_weui.dart';
3+
class DialogExample extends StatelessWidget {
4+
@override
5+
Widget build(BuildContext context) {
6+
return Scaffold(
7+
appBar: AppBar(title: Text("Dialog"),),
8+
body: Center(
9+
child: Column(
10+
children: <Widget>[
11+
FlatButton(onPressed: (){
12+
WDialog.show(context,title: "Title",content: "Context",actions: [
13+
DialogActions(text: "取消"),
14+
DialogActions(text: "确定")
15+
]);
16+
}, child: Text("Dialog_Android")),
17+
FlatButton(onPressed: (){
18+
WDialog.show(context,title: "Title",content: "Context",actions: [
19+
DialogActions(text: "取消"),
20+
DialogActions(text: "确定")
21+
],platform: TargetPlatform.iOS);
22+
}, child: Text("Dialog_Ios"))
23+
],
24+
),
25+
),
26+
);
27+
}
28+
}

0 commit comments

Comments
 (0)