Browse Source

首页 界面搭建

lailin 4 years ago
parent
commit
946e0b1a1b
1 changed files with 45 additions and 41 deletions
  1. 45 41
      taskservice/lib/src/home/home.dart

+ 45 - 41
taskservice/lib/src/home/home.dart

@@ -1,3 +1,4 @@
+import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:taskservice/Common/JXColors.dart';
@@ -107,7 +108,7 @@ class _MyHomePageState extends State<MyHomePage> {
                   mainAxisAlignment: MainAxisAlignment.start,
                   children: <Widget>[
                     Container(
-                      padding: EdgeInsets.only(left: 12.0,top: 12.0),
+                      padding: EdgeInsets.only(left: 12.0, top: 12.0),
                       width: 120.0,
                       child: Text(
                         model.name,
@@ -128,11 +129,10 @@ class _MyHomePageState extends State<MyHomePage> {
                               color: JXColors.k2E3032,
                             ),
                           ),
-                        )
-                    )
+                        ))
                   ],
                 ),
-                Row (
+                Row(
                   mainAxisAlignment: MainAxisAlignment.start,
                   children: [
                     Expanded(
@@ -171,19 +171,30 @@ class _MyHomePageState extends State<MyHomePage> {
               mainAxisAlignment: MainAxisAlignment.start,
               children: <Widget>[
                 Container(
-                    color: JXColors.kF0F0F0,
+                  color: JXColors.kF0F0F0,
+                  padding: EdgeInsets.fromLTRB(12.0, 8, 12.0, 8),
+                  child: Container(
                     alignment: Alignment.center,
-                    padding: EdgeInsets.fromLTRB(12.0, 4.0, 12.0, 4.0),
-                    height: 50.0,
+                    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>[
-                      Container(
-                          width: 44.0,
-                          child: Icon(
-                            Icons.search,
-                            size: 24.0,
-                          )),
+                      SizedBox(
+                        width: 12,
+                      ),
+                      Icon(
+                        Icons.search,
+                        size: 24.0,
+                      ),
+                      SizedBox(
+                        width: 6,
+                      ),
                       Expanded(
                         child: TextField(
+                          maxLines: 1,
                           focusNode: blankNode,
                           obscureText: false,
                           cursorColor: JXColors.k1F2529,
@@ -192,16 +203,21 @@ class _MyHomePageState extends State<MyHomePage> {
                             hintText: '快速筛选',
                             labelStyle: TextStyle(
                               color: JXColors.k2E3032,
-                              fontSize: 18,
+                              fontSize: 24.0,
                             ),
                           ),
-                          onSubmitted: (value) {
+                          onChanged: (value) {
                             _searchText = value;
                             filterMember();
                           },
                         ),
                       ),
-                    ])),
+                      SizedBox(
+                        width: 12,
+                      ),
+                    ]),
+                  ),
+                ),
                 Expanded(
                     child: Container(
                       color: JXColors.kF0F0F0,
@@ -214,41 +230,29 @@ class _MyHomePageState extends State<MyHomePage> {
                         },
                       ),
                     )),
-                Row (
+                Row(
                   mainAxisAlignment: MainAxisAlignment.start,
                   children: <Widget>[
                     Expanded(
-                        child: FlatButton(
-                          onPressed: () {
-                            Navigator.of(context).pushNamed('$CreateAccPage');
-                            print('新建会员');
-//                            setState(() {
-//                              for (int i = 0; i < 2; i++) {
-//                                JXMemberModel model = JXMemberModel();
-//                                model.name = 'Poto';
-//                                model.tel = '1560000';
-//                                model.addr = '详细地址';
-//                                _datasource.add(model);
-//                              }
-//                            });
-                          },
-                          padding: EdgeInsets.all(0),
-                          color: JXColors.kF0F0F0,
-                          textColor: JXColors.k1F2529,
-                          child: Text('新建会员',
-                              style: TextStyle(fontSize: 14)),
-                        )
+                      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: FlatButton(
+                      child: CupertinoButton(
                         onPressed: () {
                           print('会员列表');
                         },
                         padding: EdgeInsets.all(0),
                         color: JXColors.k1F2529,
-                        textColor: JXColors.kFFFFFF,
-                        child: const Text('会员列表',
-                            style: TextStyle(fontSize: 14)),
+                        borderRadius: BorderRadius.all(Radius.circular(0)),
+                        child: Text('会员列表', style: TextStyle(fontSize: 14, color: JXColors.kFFFFFF)),
                       ),
                     ),
                   ],