Skip to content

Commit 29d4ac1

Browse files
committed
docs(panel): add panel example
1 parent 62863bc commit 29d4ac1

File tree

3 files changed

+43
-31
lines changed

3 files changed

+43
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To use this plugin, add `flutter_weui` as a [dependency in your pubspec.yaml fil
2020
- [`Footer`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/footer_example.dart)
2121
- [`LoadMore`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/load_more_example.dart)
2222
- [`MediaBox`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/media_box_example.dart)
23-
- [`Panel`]()
23+
- [`Panel`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/panel_example.dart)
2424
- [`Picker`]()
2525
- [`Slider`]()
2626
- [`Switch`]()

README_zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- [`Footer`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/footer_example.dart)
2121
- [`LoadMore`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/load_more_example.dart)
2222
- [`MediaBox`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/media_box_example.dart)
23-
- [`Panel`]()
23+
- [`Panel`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/panel_example.dart)
2424
- [`Picker`]()
2525
- [`Slider`]()
2626
- [`Switch`]()

example/lib/panel_example.dart

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_weui/flutter_weui.dart';
33

4-
class MediaBoxExample extends StatelessWidget {
4+
class PanelExample extends StatelessWidget {
55
@override
66
Widget build(BuildContext context) {
77
return Scaffold(
88
appBar: AppBar(
9-
title: Text("Cell"),
10-
),
11-
body: Cells(
12-
children: <Widget>[
13-
MediaBox(
14-
title: "Title",
15-
desc: "desc",
16-
),
17-
MediaBox(
18-
thumb: Container(
19-
width: 24,
20-
height: 24,
21-
color: Colors.red,
22-
child: Text("A"),
23-
),
24-
title: "Title",
25-
desc: "desc",
26-
),
27-
MediaBox(
28-
title: "Title",
29-
desc: "desc",
30-
info: Info(children: <Widget>[
31-
Meta(text: "文字来源",),
32-
Meta(text: "文本来源",),
33-
MetaExtra(text: "其他信息",)
34-
],),
35-
)
36-
],
9+
title: Text("Panel"),
3710
),
11+
body: Panel(
12+
title: "Panel Title",
13+
footer: true,
14+
onFooterPressed: () {},
15+
body: Cells(
16+
children: <Widget>[
17+
MediaBox(
18+
title: "Title",
19+
desc: "desc",
20+
),
21+
MediaBox(
22+
thumb: Container(
23+
width: 24,
24+
height: 24,
25+
color: Colors.red,
26+
child: Text("A"),
27+
),
28+
title: "Title",
29+
desc: "desc",
30+
),
31+
MediaBox(
32+
title: "Title",
33+
desc: "desc",
34+
info: Info(
35+
children: <Widget>[
36+
Meta(
37+
text: "文字来源",
38+
),
39+
Meta(
40+
text: "文本来源",
41+
),
42+
MetaExtra(
43+
text: "其他信息",
44+
)
45+
],
46+
),
47+
)
48+
],
49+
)),
3850
);
3951
}
4052
}

0 commit comments

Comments
 (0)