Forráskód Böngészése

首页代码位置整理

lailin 4 éve
szülő
commit
9c650f8c6d
1 módosított fájl, 85 hozzáadás és 85 törlés
  1. 85 85
      taskservice/lib/src/home/home.dart

+ 85 - 85
taskservice/lib/src/home/home.dart

@@ -57,6 +57,91 @@ 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(
+            child: Column(
+              mainAxisAlignment: MainAxisAlignment.start,
+              children: <Widget>[
+                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),
+                    itemCount: _cells.length,
+                    itemExtent: 92.0,
+                    itemBuilder: (BuildContext context, int row) {
+                      return _cells[row];
+                    },
+                  ),
+                )),
+                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,
+                            )),
+                      ),
+                    ),
+                  ],
+                )
+              ],
+            ),
+          ),
+        ));
+  }
+
   /*筛选列表数据*/
   void filterMember() {
     String text = _searchController.text;
@@ -160,89 +245,4 @@ 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(
-            child: Column(
-              mainAxisAlignment: MainAxisAlignment.start,
-              children: <Widget>[
-                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),
-                    itemCount: _cells.length,
-                    itemExtent: 92.0,
-                    itemBuilder: (BuildContext context, int row) {
-                      return _cells[row];
-                    },
-                  ),
-                )),
-                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,
-                            )),
-                      ),
-                    ),
-                  ],
-                )
-              ],
-            ),
-          ),
-        ));
-  }
 }