mirror of
https://github.com/Linloir/Simple-TCP-Client.git
synced 2025-12-17 00:38:11 +08:00
Improvements:
- Avoid image searching in history - History search ignore case match
This commit is contained in:
parent
5aa69d80f6
commit
6acd98d0bc
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author : Linloir
|
||||
* @Date : 2022-10-11 10:56:02
|
||||
* @LastEditTime : 2022-10-19 10:28:21
|
||||
* @LastEditTime : 2022-10-20 17:24:26
|
||||
* @Description : Local Service Repository
|
||||
*/
|
||||
|
||||
@ -151,9 +151,9 @@ class LocalServiceRepository {
|
||||
var currentUserID = pref.getInt('userid');
|
||||
var rawMessages = await _database.query(
|
||||
'msgs',
|
||||
where: '(userid = ? or targetid = ?)',
|
||||
where: '(userid = ? or targetid = ?) and not contenttype = ?',
|
||||
whereArgs: [
|
||||
currentUserID, currentUserID
|
||||
currentUserID, currentUserID, MessageType.image.literal
|
||||
],
|
||||
orderBy: 'timestamp desc',
|
||||
limit: 100
|
||||
@ -161,7 +161,7 @@ class LocalServiceRepository {
|
||||
List<Message> alikeMessages = [];
|
||||
for(var rawMessage in rawMessages) {
|
||||
var message = Message.fromJSONObject(jsonObject: rawMessage);
|
||||
if(message.contentDecoded.contains(pattern)) {
|
||||
if(message.contentDecoded.toLowerCase().contains(pattern.toLowerCase())) {
|
||||
alikeMessages.add(message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author : Linloir
|
||||
* @Date : 2022-10-13 17:06:52
|
||||
* @LastEditTime : 2022-10-13 21:35:11
|
||||
* @LastEditTime : 2022-10-20 17:30:37
|
||||
* @Description :
|
||||
*/
|
||||
|
||||
@ -14,10 +14,32 @@ class SearchBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextField(
|
||||
onChanged: (value) {
|
||||
context.read<SearchCubit>().onKeyChanged(value);
|
||||
},
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 2.0),
|
||||
child: TextField(
|
||||
onChanged: (value) {
|
||||
context.read<SearchCubit>().onKeyChanged(value);
|
||||
},
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.0
|
||||
),
|
||||
showCursor: true,
|
||||
cursorColor: Colors.white,
|
||||
decoration: const InputDecoration(
|
||||
border: InputBorder.none
|
||||
// errorBorder: UnderlineInputBorder(
|
||||
// borderSide: BorderSide(color: Colors.red, width: 2.0)
|
||||
// ),
|
||||
// disabledBorder: InputBorder.none,
|
||||
// enabledBorder: UnderlineInputBorder(
|
||||
// borderSide: BorderSide(color: Colors.blue, width: 2.0)
|
||||
// ),
|
||||
// focusedBorder: UnderlineInputBorder(
|
||||
// borderSide: BorderSide(color: Colors.white, width: 2.0)
|
||||
// )
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user