|
@@ -22,7 +22,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
FocusNode blankNode = FocusNode();
|
|
|
|
|
|
/*搜索值*/
|
|
|
- static final TextEditingController _searchController = TextEditingController();
|
|
|
+ static final TextEditingController _searchController =
|
|
|
+ TextEditingController();
|
|
|
|
|
|
/*tableView*/
|
|
|
List<Widget> _cells = [];
|
|
@@ -85,71 +86,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
setState(() {});
|
|
|
}
|
|
|
|
|
|
- /*筛选空间*/
|
|
|
- Widget theFilterBar() {
|
|
|
- return Container(
|
|
|
- color: JXColors.kF0F0F0,
|
|
|
- padding: EdgeInsets.fromLTRB(12.0, 8, 12.0, 8),
|
|
|
- child: Container(
|
|
|
- alignment: Alignment.center,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: JXColors.kE6E6E6,
|
|
|
- borderRadius: BorderRadius.circular(12.0),
|
|
|
- border: Border.all(color: JXColors.kE6E6E6, width: 1),
|
|
|
- ),
|
|
|
- height: 44.0,
|
|
|
- child: Row(children: <Widget>[
|
|
|
- SizedBox(
|
|
|
- width: 12,
|
|
|
- ),
|
|
|
- Icon(
|
|
|
- Icons.search,
|
|
|
- size: 24.0,
|
|
|
- ),
|
|
|
- SizedBox(
|
|
|
- width: 6,
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: TextField(
|
|
|
- controller: _searchController,
|
|
|
- maxLines: 1,
|
|
|
- focusNode: blankNode,
|
|
|
- obscureText: false,
|
|
|
- cursorColor: JXColors.k1F2529,
|
|
|
- decoration: InputDecoration(
|
|
|
- border: InputBorder.none,
|
|
|
- hintText: '快速筛选',
|
|
|
- labelStyle: TextStyle(
|
|
|
- color: JXColors.k2E3032,
|
|
|
- fontSize: 24.0,
|
|
|
- ),
|
|
|
- ),
|
|
|
- onChanged: (value) {
|
|
|
- filterMember();
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
- SizedBox(width: 6,),
|
|
|
- CupertinoButton(
|
|
|
- onPressed: () {
|
|
|
- /*清空输入框*/
|
|
|
- setState(() {
|
|
|
- _searchController.clear();
|
|
|
- filterMember();
|
|
|
- });
|
|
|
- },
|
|
|
- padding: EdgeInsets.all(0),
|
|
|
- child: Icon(
|
|
|
- Icons.cancel,
|
|
|
- color: JXColors.k747A7E,
|
|
|
- size: 24.0,
|
|
|
- ),
|
|
|
- ),
|
|
|
- ]),
|
|
|
- ),
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
/*cell*/
|
|
|
Widget theCellBuilder(BuildContext context, JXMemberModel model) {
|
|
|
return GestureDetector(
|
|
@@ -228,22 +164,34 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return GestureDetector(
|
|
|
- onTap: () {
|
|
|
- FocusScope.of(context).requestFocus(blankNode);
|
|
|
- },
|
|
|
- child: Scaffold(
|
|
|
- appBar: AppBar(
|
|
|
- title: Text(widget.title),
|
|
|
- ),
|
|
|
- body: SafeArea(
|
|
|
+ onTap: () {
|
|
|
+ FocusScope.of(context).requestFocus(blankNode);
|
|
|
+ },
|
|
|
+ child: Scaffold(
|
|
|
+ appBar: AppBar(
|
|
|
+ title: Text(widget.title),
|
|
|
+ ),
|
|
|
+ body: SafeArea(
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: <Widget>[
|
|
|
- SearchBar(hint: '快速筛选', onTextChanged: (value) {
|
|
|
- filterMember();
|
|
|
- }, focusNode: blankNode,),
|
|
|
- Expanded(
|
|
|
- child: Container(
|
|
|
+ SearchBar(
|
|
|
+ hint: '快速筛选',
|
|
|
+ onTextChanged: (value) {
|
|
|
+ filterMember();
|
|
|
+ },
|
|
|
+ focusNode: blankNode,
|
|
|
+ onBtnClear: () {
|
|
|
+ /*清空*/
|
|
|
+ setState(() {
|
|
|
+ _searchController.clear();
|
|
|
+ filterMember();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ searchController: _searchController,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
color: JXColors.kF0F0F0,
|
|
|
child: ListView.builder(
|
|
|
padding: EdgeInsets.only(left: 12.0, right: 12.0),
|
|
@@ -254,48 +202,47 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
},
|
|
|
),
|
|
|
)),
|
|
|
- Row(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: <Widget>[
|
|
|
- Expanded(
|
|
|
- child: CupertinoButton(
|
|
|
- onPressed: ()
|
|
|
- {
|
|
|
- Navigator.of(context).pushNamed('$CreateAccPage');
|
|
|
- },
|
|
|
- padding: EdgeInsets.all(0),
|
|
|
- color: JXColors.kFFFFFF,
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(0)),
|
|
|
- child: Text(
|
|
|
- '新建会员',
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14,
|
|
|
- color: JXColors.k101E40,
|
|
|
+ Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ Expanded(
|
|
|
+ child: CupertinoButton(
|
|
|
+ onPressed: () {
|
|
|
+ Navigator.of(context).pushNamed('$CreateAccPage');
|
|
|
+ },
|
|
|
+ padding: EdgeInsets.all(0),
|
|
|
+ color: JXColors.kFFFFFF,
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(0)),
|
|
|
+ child: Text(
|
|
|
+ '新建会员',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14,
|
|
|
+ color: JXColors.k101E40,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: CupertinoButton(
|
|
|
+ onPressed: () {
|
|
|
+ print('会员列表');
|
|
|
+ Navigator.of(context).pushNamed('$AccountListPage');
|
|
|
+ },
|
|
|
+ padding: EdgeInsets.all(0),
|
|
|
+ color: JXColors.k1F2529,
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(0)),
|
|
|
+ child: Text('会员列表',
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14,
|
|
|
+ color: JXColors.kFFFFFF,
|
|
|
+ )),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- child: CupertinoButton(
|
|
|
- onPressed: () {
|
|
|
- print('会员列表');
|
|
|
- Navigator.of(context).pushNamed('$AccountListPage');
|
|
|
- },
|
|
|
- padding: EdgeInsets.all(0),
|
|
|
- color: JXColors.k1F2529,
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(0)),
|
|
|
- child: Text('会员列表',
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14,
|
|
|
- color: JXColors.kFFFFFF,
|
|
|
- )),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- ));
|
|
|
+ ));
|
|
|
}
|
|
|
}
|