File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
lib/app/modules/chat/presentation/widgets Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class _ChatInputState extends State<ChatInput> {
2424 void initState () {
2525 super .initState ();
2626 _controller.addListener (() {
27- setState (() => _filled = _controller.text.isNotEmpty);
27+ setState (() => _filled = _controller.text.trim (). isNotEmpty);
2828 });
2929 }
3030
@@ -76,11 +76,15 @@ class _ChatInputState extends State<ChatInput> {
7676 BlendMode .srcIn,
7777 ),
7878 ),
79- onPressed: () {
80- L .c ('sendMessage' );
81- context.read <ChatBloc >().add (ChatSendChat (_controller.text));
82- _controller.clear ();
83- },
79+ onPressed: _filled
80+ ? () {
81+ L .c ('sendMessage' );
82+ context.read <ChatBloc >().add (
83+ ChatSendChat (_controller.text.trim ()),
84+ );
85+ _controller.clear ();
86+ }
87+ : null ,
8488 ),
8589 ],
8690 ),
You can’t perform that action at this time.
0 commit comments