Skip to content

Commit 848cb67

Browse files
committed
docs(cell): add cell example
1 parent 0d9eae8 commit 848cb67

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To use this plugin, add `flutter_weui` as a [dependency in your pubspec.yaml fil
1515
- [`Button`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/button_example.dart)
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)
18-
- [`Cell`]()
18+
- [`Cell`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/cell_example.dart)
1919
- [`Dialog`]()
2020
- [`Footer`]()
2121
- [`LoadMore`]()

README_zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- [`Button`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/button_example.dart)
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)
18-
- [`Cell`]()
18+
- [`Cell`](https://github.com/flutter-studio/flutter-weui/blob/master/example/lib/cell_example.dart)
1919
- [`Dialog`]()
2020
- [`Footer`]()
2121
- [`LoadMore`]()

example/lib/cell_example.dart

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_weui/flutter_weui.dart';
3+
class CellExample extends StatelessWidget {
4+
@override
5+
Widget build(BuildContext context) {
6+
return Scaffold(
7+
appBar: AppBar(title: Text("Cell"),),
8+
body: Cells(
9+
children: <Widget>[
10+
CellInput(
11+
keyBoardType: KeyBoardType.number,
12+
label: "number",
13+
),
14+
CellInput(
15+
keyBoardType: KeyBoardType.text,
16+
label: "text",
17+
),
18+
CellInput(
19+
keyBoardType: KeyBoardType.password,
20+
label: "password",
21+
),
22+
CellSelect(
23+
options: ["1", "2", "3"],
24+
initialIndex: 2,
25+
onChanged: (value) {
26+
print(value);
27+
},
28+
),
29+
Cell(
30+
title: "Cell",
31+
banner: Icon(
32+
Icons.arrow_back,
33+
size: 20,
34+
),
35+
access: true,
36+
secondaryText: "说明文字",
37+
onPressed: () {
38+
ActionSheet.show(
39+
context: context,
40+
data: ["1", "3", "sdfs"],
41+
onPress: (details) {
42+
print(details.toString());
43+
});
44+
},
45+
radio: true,
46+
checkBox: true,
47+
),
48+
],
49+
),
50+
);
51+
}
52+
}

0 commit comments

Comments
 (0)