|
...
|
...
|
@@ -41,13 +41,23 @@ class _ContantItemPageState extends State<ContantItemPage> { |
|
|
|
: userHistoryEntity.rname;
|
|
|
|
String pinyinFirst = userHistoryEntity.pinyinFirst;
|
|
|
|
List<String> pinyinList = userHistoryEntity.pinyinList;
|
|
|
|
|
|
|
|
if (pinyinList.indexOf(key) != -1) {
|
|
|
|
keyTemp = name.substring(
|
|
|
|
pinyinList.indexOf(key), pinyinList.indexOf(key) + 1);
|
|
|
|
} else if (pinyinFirst.contains(key)) {
|
|
|
|
String pinyin = userHistoryEntity.pinyin;
|
|
|
|
// if (pinyinList.indexOf(key) != -1) {
|
|
|
|
// //全拼音检索一个字
|
|
|
|
// keyTemp = name.substring(
|
|
|
|
// pinyinList.indexOf(key), pinyinList.indexOf(key) + 1);
|
|
|
|
// } else
|
|
|
|
if (pinyinFirst.contains(key)) {
|
|
|
|
keyTemp = name.substring(
|
|
|
|
pinyinFirst.indexOf(key), pinyinFirst.indexOf(key) + 1);
|
|
|
|
pinyinFirst.indexOf(key), pinyinFirst.indexOf(key) + key.length);
|
|
|
|
} else if (pinyin.indexOf(key) != -1) {
|
|
|
|
if (pinyinList.indexOf(key) != -1) {
|
|
|
|
//全拼音检索 lilao
|
|
|
|
keyTemp = name.substring(0, pinyinList.indexOf(key) + 1);
|
|
|
|
} else if (pinyinFirst.contains(key)) {
|
|
|
|
keyTemp = name.substring(
|
|
|
|
pinyinFirst.indexOf(key), pinyinFirst.indexOf(key) + key.length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
print(keyTemp);
|
|
...
|
...
|
@@ -130,7 +140,7 @@ class _ContantItemPageState extends State<ContantItemPage> { |
|
|
|
|
|
|
|
String key = widget.model.controller.text;
|
|
|
|
String pinyinFirst = userHistoryEntity.pinyinFirst;
|
|
|
|
|
|
|
|
List<String> pinyinList = userHistoryEntity.pinyinList;
|
|
|
|
if (key == '') {
|
|
|
|
return Text(name,
|
|
|
|
style: TextStyle(
|
|
...
|
...
|
@@ -138,11 +148,15 @@ class _ContantItemPageState extends State<ContantItemPage> { |
|
|
|
} else {
|
|
|
|
return (name.contains(key) && name.length != key.length) ||
|
|
|
|
(pinyinFirst.contains(key) && pinyinFirst.length != key.length) ||
|
|
|
|
(pinyinFirst.contains(key) && pinyinFirst.length != key.length)
|
|
|
|
(pinyinList.contains(key) && pinyinList.length != key.length)
|
|
|
|
? _startPlaceWidget(name, key, userHistoryEntity)
|
|
|
|
: Text(name,
|
|
|
|
style: TextStyle(
|
|
|
|
color: name.length == key.length
|
|
|
|
color: ((name.contains(key) && name.length == key.length) ||
|
|
|
|
(pinyinFirst.contains(key) &&
|
|
|
|
pinyinFirst.length == key.length) ||
|
|
|
|
(pinyinList.contains(key) &&
|
|
|
|
pinyinList.length == key.length))
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(32)));
|
|
...
|
...
|
@@ -157,20 +171,17 @@ class _ContantItemPageState extends State<ContantItemPage> { |
|
|
|
: userHistoryEntity.phone;
|
|
|
|
|
|
|
|
String key = widget.model.controller.text;
|
|
|
|
String pinyinFirst = userHistoryEntity.pinyinFirst;
|
|
|
|
|
|
|
|
if (key == '') {
|
|
|
|
return Text(phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333, fontSize: ScreenUtil().setSp(32)));
|
|
|
|
} else {
|
|
|
|
return (phone.contains(key) && phone.length != key.length) ||
|
|
|
|
(pinyinFirst.contains(key) && pinyinFirst.length != key.length) ||
|
|
|
|
(pinyinFirst.contains(key) && pinyinFirst.length != key.length)
|
|
|
|
return (phone.contains(key) && phone.length != key.length)
|
|
|
|
? _getWidget(phone, key, fontSize: 30)
|
|
|
|
: Text(phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: phone.length == key.length
|
|
|
|
color: phone.contains(key) && phone.length == key.length
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30)));
|
...
|
...
|
|