Skip to content
Merged
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
2 changes: 1 addition & 1 deletion app/lib/pages/conversations/conversations_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _ConversationsPageState extends State<ConversationsPage> with AutomaticKee
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (index == 0) const SizedBox(height: 16),
if (index == 0) const SizedBox(height: 10),
ConversationsGroupWidget(
isFirst: index == 0,
conversations: memoriesForDate,
Expand Down
108 changes: 66 additions & 42 deletions app/lib/pages/conversations/widgets/search_widget.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:friend_private/backend/preferences.dart';
import 'package:friend_private/providers/conversation_provider.dart';
import 'package:friend_private/providers/home_provider.dart';
import 'package:friend_private/utils/other/debouncer.dart';
Expand Down Expand Up @@ -26,50 +27,73 @@ class _SearchWidgetState extends State<SearchWidget> {

@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 2),
width: MediaQuery.sizeOf(context).width * 0.9,
child: TextFormField(
controller: searchController,
focusNode: context.read<HomeProvider>().convoSearchFieldFocusNode,
onChanged: (value) {
var provider = Provider.of<ConversationProvider>(context, listen: false);
_debouncer.run(() async {
await provider.searchConversations(value);
});
setShowClearButton();
},
decoration: InputDecoration(
hintText: 'Search Conversations',
hintStyle: const TextStyle(color: Colors.white),
filled: true,
fillColor: Colors.grey[900],
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
padding: const EdgeInsets.fromLTRB(16, 16, 2, 0),
width: MediaQuery.sizeOf(context).width * 0.85,
child: TextFormField(
controller: searchController,
focusNode: context.read<HomeProvider>().convoSearchFieldFocusNode,
onChanged: (value) {
var provider = Provider.of<ConversationProvider>(context, listen: false);
_debouncer.run(() async {
await provider.searchConversations(value);
});
setShowClearButton();
},
decoration: InputDecoration(
hintText: 'Search Conversations',
hintStyle: TextStyle(color: Colors.grey.shade500),
filled: false,
// fillColor: Colors.grey[900],
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.grey.shade900, width: 0.5),
),
prefixIcon: Icon(
Icons.search,
color: Colors.grey.shade500,
),
suffixIcon: showClearButton
? GestureDetector(
onTap: () {
var provider = Provider.of<ConversationProvider>(context, listen: false);
provider.resetGroupedConvos();
searchController.clear();
setShowClearButton();
},
child: const Icon(
Icons.close,
color: Colors.white,
),
)
: null,
contentPadding: const EdgeInsets.symmetric(horizontal: 12),
),
style: const TextStyle(color: Colors.white),
),
prefixIcon: const Icon(
Icons.search,
color: Colors.white,
),
suffixIcon: showClearButton
? GestureDetector(
onTap: () {
var provider = Provider.of<ConversationProvider>(context, listen: false);
provider.resetGroupedConvos();
searchController.clear();
setShowClearButton();
},
child: const Icon(
Icons.close,
color: Colors.white,
),
)
: null,
contentPadding: const EdgeInsets.symmetric(horizontal: 12),
),
style: const TextStyle(color: Colors.white),
),
Consumer2<ConversationProvider, HomeProvider>(builder: (context, convoProvider, home, child) {
if (home.selectedIndex != 0 ||
!convoProvider.hasNonDiscardedConversations ||
convoProvider.isLoadingConversations) {
return const SizedBox.shrink();
}
return Padding(
padding: const EdgeInsets.only(left: 2.0, top: 12),
child: IconButton(
onPressed: convoProvider.toggleDiscardConversations,
icon: Icon(
SharedPreferencesUtil().showDiscardedMemories ? Icons.filter_list_off_sharp : Icons.filter_list,
color: Colors.white,
size: 24,
),
),
);
}),
],
);
}
}
18 changes: 0 additions & 18 deletions app/lib/pages/home/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -487,24 +487,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
}
},
),
Consumer2<ConversationProvider, HomeProvider>(builder: (context, convoProvider, home, child) {
if (home.selectedIndex != 0 ||
!convoProvider.hasNonDiscardedConversations ||
convoProvider.isLoadingConversations) {
return const SizedBox.shrink();
}
return Padding(
padding: const EdgeInsets.only(left: 4.0),
child: IconButton(
onPressed: convoProvider.toggleDiscardConversations,
icon: Icon(
SharedPreferencesUtil().showDiscardedMemories ? Icons.filter_list_off_sharp : Icons.filter_list,
color: Colors.white,
size: 24,
),
),
);
}),
IconButton(
icon: const Icon(Icons.settings, color: Colors.white, size: 30),
onPressed: () async {
Expand Down