Skip to content

Commit 4235f79

Browse files
committed
feat: CheckBox
1 parent 725ca1a commit 4235f79

File tree

6 files changed

+100
-0
lines changed

6 files changed

+100
-0
lines changed

docs/widget/form/checkbox/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## **CheckBox**

lib/widget/form/checkbox/demo.dart

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import 'package:flutter/material.dart';
2+
3+
class Index extends StatefulWidget {
4+
@override
5+
_IndexState createState() => _IndexState();
6+
}
7+
8+
class _IndexState extends State<Index> {
9+
bool _checkBoxValue = false;
10+
11+
@override
12+
Widget build(BuildContext context) {
13+
return ListView(
14+
children: <Widget>[
15+
Center(
16+
child: Checkbox(
17+
value: _checkBoxValue,
18+
onChanged: (value) {
19+
setState(() {
20+
_checkBoxValue = value;
21+
});
22+
},
23+
),
24+
)
25+
],
26+
);
27+
}
28+
}
29+
30+
31+
// class CheckBoxDemo extends StatefulWidget {
32+
// @override
33+
// _CheckBoxDemoState createState() => _CheckBoxDemoState();
34+
// }
35+
36+
// class _CheckBoxDemoState extends State<CheckBoxDemo> {
37+
// bool _checkBoxValue;
38+
// // _CheckBoxDemoState({Key key, this._checkBoxValue}):super(key: key);
39+
// @override
40+
// Widget build(BuildContext context) {
41+
// return Checkbox(
42+
// value: _checkBoxValue,
43+
// onChanged: (value) {
44+
// setState(() {
45+
// _checkBoxValue = value;
46+
// });
47+
// },
48+
// );
49+
// }
50+
// }
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:efox_flutter/components/widgetComp.dart' as WidgetComp;
3+
import 'demo.dart' as Demo;
4+
5+
class Index extends StatefulWidget {
6+
static String title = 'CheckBox';
7+
static String originCodeUrl = '';
8+
static String mdUrl = 'docs/widget/form/checkbox/index.md';
9+
@override
10+
_IndexState createState() => _IndexState();
11+
}
12+
13+
class _IndexState extends State<Index> {
14+
@override
15+
Widget build(BuildContext context) {
16+
return WidgetComp.Index(
17+
title: Index.title,
18+
originCodeUrl: Index.originCodeUrl,
19+
mdUrl: Index.mdUrl,
20+
demoChild: <Widget>[
21+
Demo.Index()
22+
],
23+
);
24+
}
25+
}

lib/widget/form/index.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:efox_flutter/store/objects/widget_info.dart';
2+
import 'checkbox/index.dart' as CheckBox;
3+
4+
const nameSpaces = '/form_';
5+
6+
List widgets = [
7+
ItemInfo(
8+
widget: CheckBox.Index(),
9+
code: 57923, // format_paint
10+
title: CheckBox.Index.title
11+
)
12+
];
13+
14+
List widgetMap = [
15+
ItemListInfo(
16+
nameSpaces: nameSpaces,
17+
widgetList: widgets,
18+
typeName: 'Form',
19+
code: 58746 // fastfood
20+
)
21+
];

lib/widget/index.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import 'scrollview/index.dart' as scrollview;
22
import 'regular/index.dart' as regular;
33
import 'navigator/index.dart' as navigator;
44
import 'bulletbox/index.dart' as BulletBox;
5+
import 'form/index.dart' as Form;
56
List getAllWidgets() {
67
List routerMap =[];
78
routerMap.addAll(scrollview.widgetMap);
89
routerMap.addAll(regular.widgetMap);
910
routerMap.addAll(navigator.widgetMap);
1011
routerMap.addAll(BulletBox.widgetMap);
12+
routerMap.addAll(Form.widgetMap);
1113
return routerMap;
1214
}

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ flutter:
8686
- docs/widget/bulletbox/bottomsheet/
8787
- docs/widget/bulletbox/snackbar/
8888
- docs/widget/bulletbox/expansionpanel/
89+
- docs/widget/form/checkbox/
8990
- docs/widget/navigator/appbar/
9091
- docs/widget/navigator/scaffold/
9192
# An image asset can refer to one or more resolution-specific "variants", see

0 commit comments

Comments
 (0)