[Message Input] fix icons padding

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2020-12-23 19:03:28 +05:30
parent 47dafef2ac
commit db7593b622
+21 -28
View File
@@ -248,7 +248,7 @@ class MessageInputState extends State<MessageInput> {
], ],
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.all(8.0),
child: _buildTextField(context), child: _buildTextField(context),
), ),
if (widget.parentMessage != null) if (widget.parentMessage != null)
@@ -367,18 +367,24 @@ class MessageInputState extends State<MessageInput> {
return AnimatedCrossFade( return AnimatedCrossFade(
crossFadeState: crossFadeState:
_actionsShrunk ? CrossFadeState.showFirst : CrossFadeState.showSecond, _actionsShrunk ? CrossFadeState.showFirst : CrossFadeState.showSecond,
firstChild: IconButton( firstChild: Padding(
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
child: IconButton(
onPressed: () { onPressed: () {
setState(() { setState(() {
_actionsShrunk = false; _actionsShrunk = false;
}); });
}, },
visualDensity: VisualDensity.compact,
splashRadius: 24,
padding: const EdgeInsets.all(0),
icon: StreamSvgIcon.emptyCircleLeft( icon: StreamSvgIcon.emptyCircleLeft(
color: StreamChatTheme.of(context).accentColor, color: StreamChatTheme.of(context).accentColor,
), ),
padding: const EdgeInsets.all(0),
constraints: BoxConstraints.tightFor(
height: 24,
width: 24,
),
splashRadius: 24,
),
), ),
secondChild: Row( secondChild: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@@ -456,7 +462,7 @@ class MessageInputState extends State<MessageInput> {
StreamChatTheme.of(context).accentColor, StreamChatTheme.of(context).accentColor,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
labelPadding: labelPadding:
EdgeInsets.symmetric(horizontal: 9.0), EdgeInsets.symmetric(horizontal: 8.0),
label: Row( label: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@@ -466,7 +472,7 @@ class MessageInputState extends State<MessageInput> {
size: 16.0, size: 16.0,
), ),
Text( Text(
_chosenCommand?.name?.toUpperCase() ?? "", _chosenCommand?.name?.toUpperCase() ?? '',
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 12.0), color: Colors.white, fontSize: 12.0),
), ),
@@ -478,17 +484,12 @@ class MessageInputState extends State<MessageInput> {
suffixIcon: _commandEnabled suffixIcon: _commandEnabled
? IconButton( ? IconButton(
icon: StreamSvgIcon.close_small(), icon: StreamSvgIcon.close_small(),
splashRadius: 24,
onPressed: () { onPressed: () {
setState(() { setState(() => _commandEnabled = false);
_commandEnabled = false;
});
}, },
) )
: null, : null,
suffixIconConstraints: BoxConstraints(
maxHeight: 24.0,
maxWidth: 40.0,
),
), ),
textCapitalization: TextCapitalization.sentences, textCapitalization: TextCapitalization.sentences,
), ),
@@ -1548,7 +1549,7 @@ class MessageInputState extends State<MessageInput> {
Widget _buildCommandButton() { Widget _buildCommandButton() {
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
child: IconButton( child: IconButton(
icon: StreamSvgIcon.lightning( icon: StreamSvgIcon.lightning(
color: _commandsOverlay != null color: _commandsOverlay != null
@@ -1588,11 +1589,8 @@ class MessageInputState extends State<MessageInput> {
} }
Widget _buildAttachmentButton() { Widget _buildAttachmentButton() {
var padding = widget.editMessage == null ? 4.0 : 8.0; return Padding(
return Center( padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
child: Padding(
padding:
EdgeInsets.only(left: 8.0, right: padding, top: 8.0, bottom: 8.0),
child: IconButton( child: IconButton(
icon: StreamSvgIcon.attach( icon: StreamSvgIcon.attach(
color: _openFilePickerSection color: _openFilePickerSection
@@ -1624,7 +1622,6 @@ class MessageInputState extends State<MessageInput> {
} }
}, },
), ),
),
); );
} }
@@ -1924,20 +1921,17 @@ class MessageInputState extends State<MessageInput> {
Widget _buildIdleSendButton(BuildContext context) { Widget _buildIdleSendButton(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
child: Center(
child: StreamSvgIcon( child: StreamSvgIcon(
assetName: _getIdleSendIcon(), assetName: _getIdleSendIcon(),
color: Colors.grey, color: Colors.grey,
), ),
),
); );
} }
Widget _buildSendButton(BuildContext context) { Widget _buildSendButton(BuildContext context) {
return Center( return Padding(
child: Padding( padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 8),
padding: const EdgeInsets.all(8.0),
child: IconButton( child: IconButton(
onPressed: sendMessage, onPressed: sendMessage,
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
@@ -1952,7 +1946,6 @@ class MessageInputState extends State<MessageInput> {
color: StreamChatTheme.of(context).accentColor, color: StreamChatTheme.of(context).accentColor,
), ),
), ),
),
); );
} }