mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-04-27 04:47:51 +02: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) {
|
void onSearchEnter(String text) {
|
||||||
if (text.isEmpty) {
|
if (text.isEmpty) {
|
||||||
cancelSearch();
|
cancelSearch(unfocus: false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,14 +236,14 @@ class ChatListController extends State<ChatList>
|
|||||||
_coolDown = Timer(const Duration(milliseconds: 500), _search);
|
_coolDown = Timer(const Duration(milliseconds: 500), _search);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cancelSearch() {
|
void cancelSearch({bool unfocus = true}) {
|
||||||
setState(() {
|
setState(() {
|
||||||
searchController.clear();
|
searchController.clear();
|
||||||
isSearchMode = false;
|
isSearchMode = false;
|
||||||
roomSearchResult = userSearchResult = null;
|
roomSearchResult = userSearchResult = null;
|
||||||
isSearching = false;
|
isSearching = false;
|
||||||
});
|
});
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
if (unfocus) FocusManager.instance.primaryFocus?.unfocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isTorBrowser = false;
|
bool isTorBrowser = false;
|
||||||
|
@ -67,18 +67,17 @@ class ChatListHeader extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
),
|
),
|
||||||
suffixIcon: controller.isSearchMode
|
suffixIcon: controller.isSearchMode
|
||||||
? controller.isSearching
|
? controller.isSearching
|
||||||
? const Align(
|
? const Padding(
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
vertical: 8.0, horizontal: 12),
|
vertical: 10.0,
|
||||||
|
horizontal: 12,
|
||||||
|
),
|
||||||
child: SizedBox.square(
|
child: SizedBox.square(
|
||||||
dimension: 24,
|
dimension: 24,
|
||||||
child: CircularProgressIndicator.adaptive(
|
child: CircularProgressIndicator.adaptive(
|
||||||
strokeWidth: 2,
|
strokeWidth: 2,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: TextButton(
|
: TextButton(
|
||||||
onPressed: controller.setServer,
|
onPressed: controller.setServer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user