Skip to content

Commit 32ddea2

Browse files
Feature/explore search (#219)
1 parent fb7f909 commit 32ddea2

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

lam7a/lib/features/Explore/ui/view/search_and_auto_complete/recent_searchs_view.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ class RecentView extends ConsumerWidget {
6161
final user = state.recentSearchedUsers![index];
6262
return _HorizontalUserCard(
6363
p: user,
64-
onTap: () => () {
64+
onTap: () {
65+
//print("user tapped: ${user.username}");
6566
Navigator.push(
6667
context,
6768
MaterialPageRoute(

lam7a/lib/features/Explore/ui/view/search_and_auto_complete/search_page.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class _SearchMainPageState extends ConsumerState<SearchMainPage> {
3838

3939
@override
4040
Widget build(BuildContext context) {
41+
final async = ref.watch(searchViewModelProvider);
4142
final vm = ref.read(searchViewModelProvider.notifier);
4243
ThemeData theme = Theme.of(context);
4344

@@ -195,8 +196,6 @@ class _SearchMainPageState extends ConsumerState<SearchMainPage> {
195196
if (text.isEmpty) {
196197
return const RecentView(key: ValueKey("recent_view"));
197198
}
198-
199-
// When the user types → show autocomplete + suggested users
200199
return const SearchAutocompleteView(key: ValueKey("autocomplete_view"));
201200
}
202201
}

lam7a/lib/features/Explore/ui/viewmodel/search_viewmodel.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class SearchViewModel extends AsyncNotifier<SearchState> {
1414
Timer? _debounce;
1515
late final SearchRepository _searchRepository;
1616

17-
// FIX: Controller is stored in ViewModel (NOT in SearchState)
1817
late final TextEditingController searchController;
1918

2019
@override
@@ -44,9 +43,6 @@ class SearchViewModel extends AsyncNotifier<SearchState> {
4443
return loaded;
4544
}
4645

47-
// -----------------------------
48-
// SAME LOGIC — controller preserved
49-
// -----------------------------
5046
void onChanged(String query) {
5147
_debounce?.cancel();
5248

@@ -99,7 +95,6 @@ class SearchViewModel extends AsyncNotifier<SearchState> {
9995
}
10096
}
10197

102-
// SAME LOGIC
10398
void insertSearchedTerm(String term) {
10499
final current = state.value;
105100
if (current == null) return;

0 commit comments

Comments
 (0)