modify condition

This commit is contained in:
Salvatore Giordano
2020-10-28 11:42:09 +01:00
parent bb46710f24
commit d5f23549f4
2 changed files with 20 additions and 9 deletions
+5 -2
View File
@@ -218,13 +218,16 @@ class MessageActionsModal extends StatelessWidget {
StreamIcons.edit, StreamIcons.edit,
size: 22, size: 22,
color: color:
StreamChatTheme.of(context).primaryIconTheme.color, StreamChatTheme.of(context).primaryIconTheme.color,
), ),
onPressed: () {}, onPressed: () {},
), ),
Text( Text(
'Edit message', 'Edit message',
style: Theme.of(context).textTheme.headline6.copyWith(fontWeight: FontWeight.bold), style: Theme.of(context)
.textTheme
.headline6
.copyWith(fontWeight: FontWeight.bold),
), ),
IconButton( IconButton(
icon: Icon( icon: Icon(
+15 -7
View File
@@ -192,7 +192,7 @@ class MessageInputState extends State<MessageInput> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: _buildTextField(context), child: _buildTextField(context),
), ),
if(widget.parentMessage != null) if (widget.parentMessage != null)
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: _buildDmCheckbox(), child: _buildDmCheckbox(),
@@ -222,7 +222,11 @@ class MessageInputState extends State<MessageInput> {
Widget _buildDmCheckbox() { Widget _buildDmCheckbox() {
return Row( return Row(
children: [ children: [
Checkbox(value: _sendAsDm, onChanged: (val) => setState(() {_sendAsDm = val;})), Checkbox(
value: _sendAsDm,
onChanged: (val) => setState(() {
_sendAsDm = val;
})),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Text('Send also as direct message'), child: Text('Send also as direct message'),
@@ -316,9 +320,11 @@ class MessageInputState extends State<MessageInput> {
var matchedCommandsList = StreamChannel.of(context) var matchedCommandsList = StreamChannel.of(context)
.channel .channel
.config .config
.commands.where((element) => element.name == s.substring(1)).toList(); .commands
.where((element) => element.name == s.substring(1))
.toList();
if(matchedCommandsList.length == 1) { if (matchedCommandsList.length == 1) {
_chosenCommand = matchedCommandsList[0]; _chosenCommand = matchedCommandsList[0];
textEditingController.clear(); textEditingController.clear();
_messageIsPresent = false; _messageIsPresent = false;
@@ -796,8 +802,8 @@ class MessageInputState extends State<MessageInput> {
return Center( return Center(
child: InkWell( child: InkWell(
child: Padding( child: Padding(
padding: EdgeInsets.only( padding:
left: 8.0, right: padding, top: 8.0, bottom: 8.0), EdgeInsets.only(left: 8.0, right: padding, top: 8.0, bottom: 8.0),
child: Icon(StreamIcons.attach), child: Icon(StreamIcons.attach),
), ),
onTap: () { onTap: () {
@@ -1053,7 +1059,9 @@ class MessageInputState extends State<MessageInput> {
child: Transform.rotate( child: Transform.rotate(
angle: widget.editMessage == null ? -pi / 2 : 0, angle: widget.editMessage == null ? -pi / 2 : 0,
child: Icon( child: Icon(
widget.editMessage == null ? StreamIcons.send_message : StreamIcons.check_send, widget.editMessage == null
? StreamIcons.send_message
: StreamIcons.check_send,
color: StreamChatTheme.of(context).accentColor, color: StreamChatTheme.of(context).accentColor,
), ),
), ),