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