feat: Add dm message for thread

This commit is contained in:
Deven Joshi
2020-10-27 16:03:34 +05:30
parent 5b9c3ca5b7
commit f0ec3415dc
+26 -3
View File
@@ -171,6 +171,7 @@ class MessageInputState extends State<MessageInput> {
Command _chosenCommand;
bool _actionsShrunk = false;
bool _sendAsDm = false;
/// The editing controller passed to the input TextField
TextEditingController textEditingController;
@@ -184,9 +185,19 @@ class MessageInputState extends State<MessageInput> {
_focusNode.unfocus();
}
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: _buildTextField(context),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: _buildTextField(context),
),
if(widget.parentMessage != null)
Padding(
padding: const EdgeInsets.all(8.0),
child: _buildDmCheckbox(),
),
],
),
),
);
@@ -208,6 +219,18 @@ class MessageInputState extends State<MessageInput> {
);
}
Widget _buildDmCheckbox() {
return Row(
children: [
Checkbox(value: _sendAsDm, onChanged: (val) => setState(() {_sendAsDm = val;})),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text('Send also as direct message'),
),
],
);
}
AnimatedCrossFade _animateSendButton(BuildContext context) {
return AnimatedCrossFade(
crossFadeState: ((_messageIsPresent || _attachments.isNotEmpty) &&