fix: Corrected padding and giphy chip

This commit is contained in:
Deven Joshi
2020-10-19 12:07:07 +05:30
parent 95e7fd22bb
commit 77978eee12
+15 -12
View File
@@ -288,6 +288,7 @@ class MessageInputState extends State<MessageInput> {
}, },
style: Theme.of(context).textTheme.bodyText2, style: Theme.of(context).textTheme.bodyText2,
autofocus: false, autofocus: false,
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Write a message', hintText: 'Write a message',
prefixText: _giphyEnabled ? null : ' ', prefixText: _giphyEnabled ? null : ' ',
@@ -295,16 +296,18 @@ class MessageInputState extends State<MessageInput> {
borderRadius: BorderRadius.circular(32), borderRadius: BorderRadius.circular(32),
), ),
contentPadding: EdgeInsets.all(4), contentPadding: EdgeInsets.all(4),
prefix: _giphyEnabled ? Chip( prefix: _giphyEnabled ? Center(
backgroundColor: StreamChatTheme.of(context).accentColor, child: Chip(
label: Row( backgroundColor: StreamChatTheme.of(context).accentColor,
mainAxisSize: MainAxisSize.min, label: Row(
children: [ mainAxisSize: MainAxisSize.min,
Icon(StreamIcons.lightning, color: Colors.white,), children: [
SizedBox(width: 2,), Icon(StreamIcons.lightning, color: Colors.white,),
Text('GIPHY', style: TextStyle(color: Colors.white),), SizedBox(width: 2,),
], Text('GIPHY', style: TextStyle(color: Colors.white),),
) ],
)
),
) : null, ) : null,
suffixIcon: _giphyEnabled ? IconButton( suffixIcon: _giphyEnabled ? IconButton(
icon: Icon(Icons.cancel_outlined), icon: Icon(Icons.cancel_outlined),
@@ -647,7 +650,7 @@ class MessageInputState extends State<MessageInput> {
return Center( return Center(
child: InkWell( child: InkWell(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 8.0, right: 4.0, top: 8.0, bottom: 8.0), padding: const EdgeInsets.only(left: 4.0, right: 8.0, top: 8.0, bottom: 8.0),
child: Icon(StreamIcons.lightning), child: Icon(StreamIcons.lightning),
), ),
onTap: () { onTap: () {
@@ -663,7 +666,7 @@ class MessageInputState extends State<MessageInput> {
return Center( return Center(
child: InkWell( child: InkWell(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 4.0, right: 8.0, top: 8.0, bottom: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 4.0, top: 8.0, bottom: 8.0),
child: Icon(StreamIcons.attach), child: Icon(StreamIcons.attach),
), ),
onTap: () { onTap: () {