|
@@ -1,6 +1,7 @@
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
+import 'package:path/path.dart';
|
|
import 'package:taskservice/Common/JXColors.dart';
|
|
import 'package:taskservice/Common/JXColors.dart';
|
|
import 'package:taskservice/Model/JXMemberModel.dart';
|
|
import 'package:taskservice/Model/JXMemberModel.dart';
|
|
import 'package:taskservice/src/acclist/page_acclist.dart';
|
|
import 'package:taskservice/src/acclist/page_acclist.dart';
|
|
@@ -18,9 +19,6 @@ class MyHomePage extends StatefulWidget {
|
|
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
// 参数
|
|
// 参数
|
|
- /*空白区域键盘消失控制*/
|
|
|
|
- FocusNode blankNode = FocusNode();
|
|
|
|
-
|
|
|
|
/*搜索值*/
|
|
/*搜索值*/
|
|
static final TextEditingController _searchController =
|
|
static final TextEditingController _searchController =
|
|
TextEditingController();
|
|
TextEditingController();
|
|
@@ -37,23 +35,35 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
JXMemberModel()
|
|
JXMemberModel()
|
|
..name = 'Jack'
|
|
..name = 'Jack'
|
|
..tel = '156000'
|
|
..tel = '156000'
|
|
- ..addr = '广州',
|
|
|
|
|
|
+ ..prov = '广东省'
|
|
|
|
+ ..city = '广州市'
|
|
|
|
+ ..area = '番禺区'
|
|
|
|
+ ..addr = '罗家村坑边街1023号。。。。。。',
|
|
JXMemberModel()
|
|
JXMemberModel()
|
|
..name = 'Ros'
|
|
..name = 'Ros'
|
|
..tel = '1523'
|
|
..tel = '1523'
|
|
- ..addr = '广州12',
|
|
|
|
|
|
+ ..prov = '广东省'
|
|
|
|
+ ..city = '广州市'
|
|
|
|
+ ..area = '番禺区'
|
|
|
|
+ ..addr = '罗家村坑边街1023号。。。。。。',
|
|
JXMemberModel()
|
|
JXMemberModel()
|
|
..name = 'Rose'
|
|
..name = 'Rose'
|
|
..tel = '156186'
|
|
..tel = '156186'
|
|
- ..addr = '广州12',
|
|
|
|
|
|
+ ..prov = '广东省'
|
|
|
|
+ ..city = '广州市'
|
|
|
|
+ ..area = '番禺区'
|
|
|
|
+ ..addr = '罗家村坑边街1023号。。。。。。',
|
|
JXMemberModel()
|
|
JXMemberModel()
|
|
..name = 'Base'
|
|
..name = 'Base'
|
|
..tel = '186'
|
|
..tel = '186'
|
|
- ..addr = '广州12',
|
|
|
|
|
|
+ ..prov = '广东省'
|
|
|
|
+ ..city = '广州市'
|
|
|
|
+ ..area = '番禺区'
|
|
|
|
+ ..addr = '罗家村坑边街1023号。。。。。。罗家村坑边街1023号',
|
|
];
|
|
];
|
|
|
|
|
|
for (JXMemberModel model in _basesource) {
|
|
for (JXMemberModel model in _basesource) {
|
|
- _cells.add(theCellBuilder(context, model));
|
|
|
|
|
|
+ _cells.add(theCellBuilder(model));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -61,7 +71,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
onTap: () {
|
|
onTap: () {
|
|
- FocusScope.of(context).requestFocus(blankNode);
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
child: MyScaffold(
|
|
child: MyScaffold(
|
|
title: '吉祥之舍',
|
|
title: '吉祥之舍',
|
|
@@ -73,7 +83,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
onTextChanged: (value) {
|
|
onTextChanged: (value) {
|
|
filterMember();
|
|
filterMember();
|
|
},
|
|
},
|
|
- focusNode: blankNode,
|
|
|
|
onBtnClear: () {
|
|
onBtnClear: () {
|
|
/*清空*/
|
|
/*清空*/
|
|
setState(() {
|
|
setState(() {
|
|
@@ -89,7 +98,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
child: ListView.builder(
|
|
child: ListView.builder(
|
|
padding: EdgeInsets.only(left: 12.0, right: 12.0),
|
|
padding: EdgeInsets.only(left: 12.0, right: 12.0),
|
|
itemCount: _cells.length,
|
|
itemCount: _cells.length,
|
|
- itemExtent: 92.0,
|
|
|
|
|
|
+ itemExtent: 138.0,
|
|
itemBuilder: (BuildContext context, int row) {
|
|
itemBuilder: (BuildContext context, int row) {
|
|
return _cells[row];
|
|
return _cells[row];
|
|
},
|
|
},
|
|
@@ -163,22 +172,22 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (JXMemberModel model in tmpItems) {
|
|
for (JXMemberModel model in tmpItems) {
|
|
- _cells.add(theCellBuilder(context, model));
|
|
|
|
|
|
+ _cells.add(theCellBuilder(model));
|
|
}
|
|
}
|
|
setState(() {});
|
|
setState(() {});
|
|
}
|
|
}
|
|
|
|
|
|
/*cell*/
|
|
/*cell*/
|
|
- Widget theCellBuilder(BuildContext context, JXMemberModel model) {
|
|
|
|
|
|
+ Widget theCellBuilder(JXMemberModel model) {
|
|
return GestureDetector(
|
|
return GestureDetector(
|
|
onTap: () {
|
|
onTap: () {
|
|
print('click cell, name:${model.name}');
|
|
print('click cell, name:${model.name}');
|
|
},
|
|
},
|
|
child: Container(
|
|
child: Container(
|
|
- height: 92.0,
|
|
|
|
|
|
+ height: 138.0,
|
|
alignment: Alignment.topCenter,
|
|
alignment: Alignment.topCenter,
|
|
child: Container(
|
|
child: Container(
|
|
- height: 80.0,
|
|
|
|
|
|
+ height: 130.0,
|
|
alignment: Alignment.center,
|
|
alignment: Alignment.center,
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
color: JXColors.kFFFFFF,
|
|
color: JXColors.kFFFFFF,
|
|
@@ -208,7 +217,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
child: Container(
|
|
child: Container(
|
|
padding: EdgeInsets.only(top: 12.0, right: 12.0),
|
|
padding: EdgeInsets.only(top: 12.0, right: 12.0),
|
|
child: Text(
|
|
child: Text(
|
|
- model.tel,
|
|
|
|
|
|
+ 'Tel:${model.tel}',
|
|
textAlign: TextAlign.right,
|
|
textAlign: TextAlign.right,
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontSize: 16,
|
|
@@ -224,17 +233,71 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
children: [
|
|
children: [
|
|
Expanded(
|
|
Expanded(
|
|
child: Container(
|
|
child: Container(
|
|
- padding: EdgeInsets.only(left: 18, top: 12, right: 18),
|
|
|
|
|
|
+ padding: EdgeInsets.fromLTRB(12.0, 6.0, 12.0, 6.0),
|
|
|
|
+ child: Text(
|
|
|
|
+ '${model.prov}${model.city}${model.area}',
|
|
|
|
+ maxLines: 1,
|
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
+ textAlign: TextAlign.right,
|
|
|
|
+ style: TextStyle(color: JXColors.k101E40, fontSize: 16.0),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
+ children: <Widget>[
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Container(
|
|
|
|
+ padding: EdgeInsets.only(left: 12.0, right: 12.0),
|
|
|
|
+ height: 24.0,
|
|
|
|
+ child: Text(
|
|
|
|
+ '${model.addr}',
|
|
|
|
+ maxLines: 1,
|
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
+ textAlign: TextAlign.right,
|
|
|
|
+ style: TextStyle(color: JXColors.k101E40, fontSize: 16.0),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ SizedBox(
|
|
|
|
+ height: 12.0,
|
|
|
|
+ child: Divider(
|
|
|
|
+ height: 1.0,
|
|
|
|
+ indent: 4.0,
|
|
|
|
+ endIndent: 4.0,
|
|
|
|
+ color: JXColors.kE6E6E6,
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ Row(
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
+ children: [
|
|
|
|
+ Container(
|
|
|
|
+ padding: EdgeInsets.only(left: 12.0),
|
|
|
|
+ width: 32,
|
|
|
|
+ child: Icon(
|
|
|
|
+ Icons.access_alarm,
|
|
|
|
+ size: 20,
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ SizedBox(width:4.0),
|
|
|
|
+ Expanded(
|
|
|
|
+ child: Container(
|
|
|
|
+ padding: EdgeInsets.only(left: 2.0, right: 12),
|
|
child: Text(
|
|
child: Text(
|
|
- '任务:${model.addr}',
|
|
|
|
|
|
+ '${model.theFirstTipsDes()}',
|
|
|
|
+ maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
- fontSize: 16,
|
|
|
|
|
|
+ fontSize: 16.0,
|
|
color: JXColors.k2E3032,
|
|
color: JXColors.k2E3032,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
- )
|
|
|
|
|
|
+ ),
|
|
],
|
|
],
|
|
)
|
|
)
|
|
],
|
|
],
|