diff --git a/packages/stream_chat_flutter/lib/src/commands_overlay.dart b/packages/stream_chat_flutter/lib/src/commands_overlay.dart index ffaec928..9f8aca1e 100644 --- a/packages/stream_chat_flutter/lib/src/commands_overlay.dart +++ b/packages/stream_chat_flutter/lib/src/commands_overlay.dart @@ -49,8 +49,9 @@ class CommandsOverlay extends StatelessWidget { child: Container( constraints: BoxConstraints.loose(size), decoration: BoxDecoration( - color: _streamChatTheme.colorTheme.barsBg, - borderRadius: BorderRadius.circular(8)), + color: _streamChatTheme.colorTheme.barsBg, + borderRadius: BorderRadius.circular(8), + ), child: ListView( padding: const EdgeInsets.all(0), shrinkWrap: true, @@ -72,9 +73,9 @@ class CommandsOverlay extends StatelessWidget { context.translations.instantCommandsLabel, style: TextStyle( color: _streamChatTheme.colorTheme.textHighEmphasis - .withOpacity(.5), + .withOpacity(0.5), ), - ) + ), ], ), ), @@ -102,7 +103,8 @@ class CommandsOverlay extends StatelessWidget { TextSpan( text: c.name.capitalize(), style: const TextStyle( - fontWeight: FontWeight.bold), + fontWeight: FontWeight.bold, + ), children: [ TextSpan( text: ' /${c.name} ${c.args}', @@ -132,7 +134,9 @@ class CommandsOverlay extends StatelessWidget { } Widget _buildCommandIcon( - StreamChatThemeData _streamChatTheme, String iconType) { + StreamChatThemeData _streamChatTheme, + String iconType, + ) { switch (iconType) { case 'giphy': return CircleAvatar( diff --git a/packages/stream_chat_flutter/lib/src/emoji_overlay.dart b/packages/stream_chat_flutter/lib/src/emoji_overlay.dart index c37dd687..0a3cb634 100644 --- a/packages/stream_chat_flutter/lib/src/emoji_overlay.dart +++ b/packages/stream_chat_flutter/lib/src/emoji_overlay.dart @@ -81,10 +81,10 @@ class EmojiOverlay extends StatelessWidget { ), style: TextStyle( color: _streamChatTheme.colorTheme.textHighEmphasis - .withOpacity(.5), + .withOpacity(0.5), ), ), - ) + ), ], ), ); diff --git a/packages/stream_chat_flutter/lib/src/message_input.dart b/packages/stream_chat_flutter/lib/src/message_input.dart index 2d6669ed..37f6eb67 100644 --- a/packages/stream_chat_flutter/lib/src/message_input.dart +++ b/packages/stream_chat_flutter/lib/src/message_input.dart @@ -17,7 +17,7 @@ import 'package:stream_chat_flutter/src/emoji_overlay.dart'; import 'package:stream_chat_flutter/src/extension.dart'; import 'package:stream_chat_flutter/src/media_list_view.dart'; import 'package:stream_chat_flutter/src/message_list_view.dart'; -import 'package:stream_chat_flutter/src/overlays.dart'; +import 'package:stream_chat_flutter/src/multi_overlay.dart'; import 'package:stream_chat_flutter/src/quoted_message_widget.dart'; import 'package:stream_chat_flutter/src/stream_chat_theme.dart'; import 'package:stream_chat_flutter/src/stream_svg_icon.dart'; @@ -639,7 +639,7 @@ class MessageInputState extends State { ), secondChild: widget.disableAttachments && !widget.showCommandsButton && - widget.actions.isNotEmpty != true + !widget.actions.isNotEmpty ? const Offstage() : Wrap( children: [ @@ -826,6 +826,7 @@ class MessageInputState extends State { final channel = StreamChannel.of(context).channel; if (value.isNotEmpty) { + // ignore: no-empty-block channel.keyStroke(widget.parentMessage?.id).catchError((e) {}); } diff --git a/packages/stream_chat_flutter/lib/src/overlays.dart b/packages/stream_chat_flutter/lib/src/multi_overlay.dart similarity index 100% rename from packages/stream_chat_flutter/lib/src/overlays.dart rename to packages/stream_chat_flutter/lib/src/multi_overlay.dart index 8d36be50..31b9d5e9 100644 --- a/packages/stream_chat_flutter/lib/src/overlays.dart +++ b/packages/stream_chat_flutter/lib/src/multi_overlay.dart @@ -2,23 +2,6 @@ import 'package:collection/collection.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_portal/flutter_portal.dart'; -/// Class that contains the parameters for building an overlay entry -class OverlayOptions { - /// Constructs a new overlay options object - /// [visible] - the visibility of the overlay - /// [widget] - the widget to be displayed - OverlayOptions({ - required this.visible, - required this.widget, - }); - - /// the visibility of the overlay - final bool visible; - - /// the widget to be displayed - final Widget widget; -} - /// Widget that renders a single overlay widget from a list of [overlayOptions] /// It shows the first one that is visible class MultiOverlay extends StatelessWidget { @@ -61,3 +44,20 @@ class MultiOverlay extends StatelessWidget { ); } } + +/// Class that contains the parameters for building an overlay entry +class OverlayOptions { + /// Constructs a new overlay options object + /// [visible] - the visibility of the overlay + /// [widget] - the widget to be displayed + OverlayOptions({ + required this.visible, + required this.widget, + }); + + /// the visibility of the overlay + final bool visible; + + /// the widget to be displayed + final Widget widget; +} diff --git a/packages/stream_chat_flutter/lib/src/video_service.dart b/packages/stream_chat_flutter/lib/src/video_service.dart index 4abe88f9..a50a43c8 100644 --- a/packages/stream_chat_flutter/lib/src/video_service.dart +++ b/packages/stream_chat_flutter/lib/src/video_service.dart @@ -7,11 +7,11 @@ import 'package:video_thumbnail/video_thumbnail.dart'; /// // ignore: prefer-match-file-name -class IVideoService { - IVideoService._(); +class _IVideoService { + _IVideoService._(); - /// Singleton instance of [IVideoService] - static final IVideoService instance = IVideoService._(); + /// Singleton instance of [_IVideoService] + static final _IVideoService instance = _IVideoService._(); final _lock = Lock(); /// compress video from [path] @@ -65,6 +65,6 @@ class IVideoService { ); } -/// Get instance of [IVideoService] +/// Get instance of [_IVideoService] // ignore: non_constant_identifier_names -IVideoService get VideoService => IVideoService.instance; +_IVideoService get VideoService => _IVideoService.instance;