⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/app/modules/home/controllers/home_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class HomeController extends GetxController {
late RxBool serverCertExists;
final Rx<SupportedLanguage> selectedLanguage = SupportedLanguage.english.obs;
final ScrollController scrollController = ScrollController();
final FocusNode searchFocusNode = FocusNode();
final RxBool showbtn = false.obs;
late TaskDatabase taskdb;
var tasks = <TaskForC>[].obs;
Expand Down Expand Up @@ -478,6 +479,11 @@ class HomeController extends GetxController {

void toggleSearch() {
searchVisible.value = !searchVisible.value;
if (searchVisible.value) {
Future.delayed(const Duration(milliseconds: 300), () {
searchFocusNode.requestFocus();
});
}
if (!searchVisible.value) {
searchedTasks.assignAll(queriedTasks);
searchController.text = '';
Expand Down Expand Up @@ -827,4 +833,9 @@ class HomeController extends GetxController {
// forReplica: taskReplica.value));
// Get.dialog(showDialog);
// }
@override
void onClose() {
searchFocusNode.dispose();
super.onClose();
}
}
4 changes: 4 additions & 0 deletions lib/app/modules/home/views/home_page_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ class HomePageBody extends StatelessWidget {
(tColors.primaryBackgroundColor!)),
controller: controller.searchController,
// shape:,
focusNode: controller.searchFocusNode,
onChanged: (value) {
controller.search(value);
},
onTapOutside: (event) {
controller.searchFocusNode.unfocus();
},

shape: WidgetStateProperty.resolveWith<OutlinedBorder?>(
(Set<WidgetState> states) {
Expand Down