From edba3d2ad5fc2dbd6607508f22e06d474f1aa2b5 Mon Sep 17 00:00:00 2001 From: Deven Joshi Date: Tue, 4 May 2021 16:58:03 +0530 Subject: [PATCH] attachment lint --- .../lib/src/attachment_actions_modal.dart | 10 +++---- .../lib/src/message_input.dart | 26 ++++++++----------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/attachment_actions_modal.dart b/packages/stream_chat_flutter/lib/src/attachment_actions_modal.dart index 98aa8d48..a8d1bddd 100644 --- a/packages/stream_chat_flutter/lib/src/attachment_actions_modal.dart +++ b/packages/stream_chat_flutter/lib/src/attachment_actions_modal.dart @@ -192,8 +192,7 @@ class AttachmentActionsModal extends StatelessWidget { VoidCallback? onTap, { Color? color, Key? key, - }) { - return Material( + }) => Material( key: key, color: StreamChatTheme.of(context).colorTheme.white, child: InkWell( @@ -216,7 +215,6 @@ class AttachmentActionsModal extends StatelessWidget { ), ), ); - } Widget _buildDownloadProgressDialog( BuildContext context, @@ -245,7 +243,7 @@ class AttachmentActionsModal extends StatelessWidget { ), child: Center( child: progress == null - ? Container( + ? SizedBox( height: 100, width: 100, child: StreamSvgIcon.error( @@ -253,7 +251,7 @@ class AttachmentActionsModal extends StatelessWidget { ), ) : progress.toProgressIndicatorValue == 1.0 - ? Container( + ? SizedBox( key: Key('completedIcon'), height: 160, width: 160, @@ -261,7 +259,7 @@ class AttachmentActionsModal extends StatelessWidget { color: theme.colorTheme.greyGainsboro, ), ) - : Container( + : SizedBox( height: 100, width: 100, child: Stack( diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index 4c58f312..b0335e52 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -812,8 +812,7 @@ class MessageInputState extends State { final renderBox = context.findRenderObject() as RenderBox; final size = renderBox.size; - return OverlayEntry(builder: (context) { - return Positioned( + return OverlayEntry(builder: (context) => Positioned( bottom: size.height + MediaQuery.of(context).viewInsets.bottom, left: 0, right: 0, @@ -821,8 +820,7 @@ class MessageInputState extends State { tween: Tween(begin: 0, end: 1), duration: Duration(milliseconds: 300), curve: Curves.easeInOutExpo, - builder: (context, val, wid) { - return Transform.scale( + builder: (context, val, wid) => Transform.scale( scale: val, child: Padding( padding: const EdgeInsets.all(8), @@ -869,7 +867,7 @@ class MessageInputState extends State { ], ), ), - SizedBox( + const SizedBox( height: 10, ), ...commands @@ -878,21 +876,21 @@ class MessageInputState extends State { onTap: () { _setCommand(c); }, - child: Container( + child: SizedBox( height: 40, child: Row( children: [ - SizedBox( + const SizedBox( width: 16, ), _buildCommandIcon(c.name), - SizedBox( + const SizedBox( width: 8, ), Text.rich( TextSpan( text: c.name.capitalize(), - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.bold), children: [ TextSpan( @@ -922,10 +920,8 @@ class MessageInputState extends State { ), ), ), - ); - }), - ); - }); + )), + )); } Widget _buildFilePickerSection() { @@ -1038,12 +1034,12 @@ class MessageInputState extends State { child: Container( decoration: BoxDecoration( color: StreamChatTheme.of(context).colorTheme.white, - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( topLeft: Radius.circular(16), topRight: Radius.circular(16), ), ), - child: Container( + child: SizedBox( width: double.infinity, child: Center( child: Padding(