send only if text is not empty
This commit is contained in:
@@ -19,6 +19,15 @@ class _MessageInputState extends State<MessageInput> {
|
||||
File _image;
|
||||
final picker = ImagePicker();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
textController.addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Align(
|
||||
@@ -72,8 +81,11 @@ class _MessageInputState extends State<MessageInput> {
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(CupertinoIcons.arrow_up_circle_fill,
|
||||
color: CupertinoColors.activeGreen, size: 35),
|
||||
child: textController.text.isNotEmpty
|
||||
? Icon(CupertinoIcons.arrow_up_circle_fill,
|
||||
color: CupertinoColors.activeGreen, size: 35)
|
||||
: Icon(CupertinoIcons.exclamationmark_circle_fill,
|
||||
color: CupertinoColors.systemRed, size: 35),
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user