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
+24 -1
View File
@@ -171,6 +171,7 @@ class MessageInputState extends State<MessageInput> {
Command _chosenCommand; Command _chosenCommand;
bool _actionsShrunk = false; bool _actionsShrunk = false;
bool _sendAsDm = false;
/// The editing controller passed to the input TextField /// The editing controller passed to the input TextField
TextEditingController textEditingController; TextEditingController textEditingController;
@@ -184,10 +185,20 @@ class MessageInputState extends State<MessageInput> {
_focusNode.unfocus(); _focusNode.unfocus();
} }
}, },
child: Padding( child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: _buildTextField(context), 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) { AnimatedCrossFade _animateSendButton(BuildContext context) {
return AnimatedCrossFade( return AnimatedCrossFade(
crossFadeState: ((_messageIsPresent || _attachments.isNotEmpty) && crossFadeState: ((_messageIsPresent || _attachments.isNotEmpty) &&