feat(ui): Fix issue with moving the TextEditingController into the Cubit
This commit is contained in:
parent
f89d3827a4
commit
155c9a6c60
@ -23,9 +23,6 @@ class ConversationsState with _$ConversationsState {
|
||||
/// Flag indicating whether the search is open or not.
|
||||
@Default(false) bool searchOpen,
|
||||
|
||||
/// The text inside the search box.
|
||||
@Default('') String searchText,
|
||||
|
||||
/// Flag indicating whether we're currently performing a search or not.
|
||||
@Default(false) bool isSearching,
|
||||
}) = _ConversationsState;
|
||||
|
@ -113,7 +113,7 @@ class ConversationsHomeAppBarState extends State<ConversationsHomeAppBar> {
|
||||
contentPadding: EdgeInsets.zero,
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
state.searchText.isNotEmpty
|
||||
context.read<ConversationsCubit>().searchBarController.text.isNotEmpty
|
||||
? Icons.close
|
||||
: Icons.search,
|
||||
size: pxToLp(72),
|
||||
|
@ -141,7 +141,7 @@ class ConversationsPageState extends State<ConversationsPage>
|
||||
|
||||
Widget _listWrapper(BuildContext context, List<Conversation> state) {
|
||||
if (state.isNotEmpty) {
|
||||
final highlightWord = context.read<ConversationsCubit>().state.searchText;
|
||||
final highlightWord = context.read<ConversationsCubit>().searchBarController.text;
|
||||
return ListView.builder(
|
||||
itemCount: state.length,
|
||||
itemBuilder: (context, index) {
|
||||
|
Loading…
Reference in New Issue
Block a user