mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
chore: Follow up fix search bar
This commit is contained in:
parent
05285b46d8
commit
54303ef635
@ -225,7 +225,7 @@ class ChatListController extends State<ChatList>
|
||||
|
||||
void onSearchEnter(String text) {
|
||||
if (text.isEmpty) {
|
||||
cancelSearch();
|
||||
cancelSearch(unfocus: false);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -236,14 +236,14 @@ class ChatListController extends State<ChatList>
|
||||
_coolDown = Timer(const Duration(milliseconds: 500), _search);
|
||||
}
|
||||
|
||||
void cancelSearch() {
|
||||
void cancelSearch({bool unfocus = true}) {
|
||||
setState(() {
|
||||
searchController.clear();
|
||||
isSearchMode = false;
|
||||
roomSearchResult = userSearchResult = null;
|
||||
isSearching = false;
|
||||
});
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
if (unfocus) FocusManager.instance.primaryFocus?.unfocus();
|
||||
}
|
||||
|
||||
bool isTorBrowser = false;
|
||||
|
@ -67,16 +67,15 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
|
||||
),
|
||||
suffixIcon: controller.isSearchMode
|
||||
? controller.isSearching
|
||||
? const Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 8.0, horizontal: 12),
|
||||
child: SizedBox.square(
|
||||
dimension: 24,
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2,
|
||||
),
|
||||
? const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 10.0,
|
||||
horizontal: 12,
|
||||
),
|
||||
child: SizedBox.square(
|
||||
dimension: 24,
|
||||
child: CircularProgressIndicator.adaptive(
|
||||
strokeWidth: 2,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user