diff --git a/docusaurus/docs/Flutter/02-stream_chat_flutter/03-custom_widgets/01-customize_message_widget.mdx b/docusaurus/docs/Flutter/02-stream_chat_flutter/03-custom_widgets/01-customize_message_widget.mdx index a33efaa15..f6d524d96 100644 --- a/docusaurus/docs/Flutter/02-stream_chat_flutter/03-custom_widgets/01-customize_message_widget.mdx +++ b/docusaurus/docs/Flutter/02-stream_chat_flutter/03-custom_widgets/01-customize_message_widget.mdx @@ -28,6 +28,32 @@ StreamMessageListView( ), ``` +### Providing Custom Reaction Icons + +By default the `StreamReactionIcon` widgets provided by the SDK are `love`, `like`, `sad`, `haha`, and `wow`. +However, you can provide your own custom reaction icons by providing a `reactionIcons` parameter to the `StreamChatConfigurationData`. + +```dart +StreamChat( + client: client, + streamChatConfigData: StreamChatConfigurationData( + reactionIcons: [ + StreamReactionIcon( + type: 'custom', + builder: (context, isHighlighted, iconSize) { + return Icon( + Icons.star, + size: iconSize, + color: isHighlighted ? Colors.red : Colors.black, + ); + }, + ), + ] + ), + child: //Your widget here +) +``` + ### Theming You can customize the `StreamMessageWidget` using the `StreamChatTheme` class, so that you can change the diff --git a/packages/stream_chat_flutter/lib/src/dialogs/confirmation_dialog.dart b/packages/stream_chat_flutter/lib/src/dialogs/confirmation_dialog.dart index 37a567100..04fd31b84 100644 --- a/packages/stream_chat_flutter/lib/src/dialogs/confirmation_dialog.dart +++ b/packages/stream_chat_flutter/lib/src/dialogs/confirmation_dialog.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:stream_chat_flutter/stream_chat_flutter.dart'; -/// /// {@template confirmationDialog} +/// {@template confirmationDialog} /// A dialog that prompts the user to take an action or cancel. /// {@endtemplate} class ConfirmationDialog extends StatelessWidget { diff --git a/packages/stream_chat_flutter/lib/src/gallery/gallery_header.dart b/packages/stream_chat_flutter/lib/src/gallery/gallery_header.dart index 19aed6e6d..ac8b811d9 100644 --- a/packages/stream_chat_flutter/lib/src/gallery/gallery_header.dart +++ b/packages/stream_chat_flutter/lib/src/gallery/gallery_header.dart @@ -7,7 +7,7 @@ import 'package:stream_chat_flutter/src/theme/themes.dart'; import 'package:stream_chat_flutter/src/utils/utils.dart'; import 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart'; -/// {@macro streamGalleryHeader} +/// {@template streamGalleryHeader} /// Header/AppBar widget for media display screen /// {@endtemplate} class StreamGalleryHeader extends StatelessWidget diff --git a/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart b/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart index 3624430fc..826f90b0a 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/bottom_row.dart @@ -263,6 +263,7 @@ class BottomRow extends StatelessWidget { // textScaleFactor is already applied to the textSpan. // // issue: https://github.com/GetStream/stream-chat-flutter/issues/1250 + // ignore: deprecated_member_use data: mediaQueryData.copyWith(textScaleFactor: 1), child: child, ), diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart index 34eb602dd..1bd9526d6 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart @@ -339,7 +339,7 @@ class StreamMessageWidget extends StatefulWidget { /// with the tap action on the reactions picker. final OnReactionsTap? onReactionsTap; - /// {@template onReactionsHover} + /// {@macro onReactionsHover} /// /// Note: Only used in desktop devices (web and desktop). final OnReactionsHover? onReactionsHover; diff --git a/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery_tile.dart b/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery_tile.dart index b93686d0b..634ba9415 100644 --- a/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery_tile.dart +++ b/packages/stream_chat_flutter/lib/src/scroll_view/photo_gallery/stream_photo_gallery_tile.dart @@ -234,7 +234,7 @@ class MediaThumbnailProvider extends ImageProvider { } @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { if (other is MediaThumbnailProvider) { return media == other.media && size == other.size && diff --git a/packages/stream_chat_flutter/lib/src/stream_chat.dart b/packages/stream_chat_flutter/lib/src/stream_chat.dart index fc4cdad0e..6365bb8ba 100644 --- a/packages/stream_chat_flutter/lib/src/stream_chat.dart +++ b/packages/stream_chat_flutter/lib/src/stream_chat.dart @@ -114,6 +114,7 @@ class StreamChatState extends State { final theme = _getTheme(context, widget.streamChatThemeData); return Theme( data: Theme.of(context).copyWith( + // ignore: deprecated_member_use useMaterial3: widget.useMaterial3, ), child: Portal( diff --git a/packages/stream_chat_flutter/lib/src/theme/stream_chat_theme.dart b/packages/stream_chat_flutter/lib/src/theme/stream_chat_theme.dart index c24948b38..39859a770 100644 --- a/packages/stream_chat_flutter/lib/src/theme/stream_chat_theme.dart +++ b/packages/stream_chat_flutter/lib/src/theme/stream_chat_theme.dart @@ -50,6 +50,7 @@ class StreamChatThemeData { Widget Function(BuildContext, User)? defaultUserImage, PlaceholderUserImage? placeholderUserImage, IconThemeData? primaryIconTheme, + @Deprecated('Use StreamChatConfigurationData.reactionIcons instead') List? reactionIcons, StreamGalleryHeaderThemeData? imageHeaderTheme, StreamGalleryFooterThemeData? imageFooterTheme, @@ -75,6 +76,7 @@ class StreamChatThemeData { defaultUserImage: defaultUserImage, placeholderUserImage: placeholderUserImage, primaryIconTheme: primaryIconTheme, + //ignore: deprecated_member_use_from_same_package reactionIcons: reactionIcons, galleryHeaderTheme: imageHeaderTheme, galleryFooterTheme: imageFooterTheme, @@ -330,6 +332,7 @@ class StreamChatThemeData { PlaceholderUserImage? placeholderUserImage, IconThemeData? primaryIconTheme, StreamChannelListHeaderThemeData? channelListHeaderTheme, + @Deprecated('Use StreamChatConfigurationData.reactionIcons instead') List? reactionIcons, StreamGalleryHeaderThemeData? galleryHeaderTheme, StreamGalleryFooterThemeData? galleryFooterTheme, diff --git a/packages/stream_chat_flutter/lib/src/utils/extensions.dart b/packages/stream_chat_flutter/lib/src/utils/extensions.dart index 3671e4a40..d4406e3ee 100644 --- a/packages/stream_chat_flutter/lib/src/utils/extensions.dart +++ b/packages/stream_chat_flutter/lib/src/utils/extensions.dart @@ -230,6 +230,7 @@ extension InputDecorationX on InputDecoration { extension BuildContextX on BuildContext { // ignore: public_member_api_docs double get textScaleFactor => + // ignore: deprecated_member_use MediaQuery.maybeOf(this)?.textScaleFactor ?? 1.0; /// Retrieves current translations according to locale diff --git a/packages/stream_chat_flutter/lib/src/utils/typedefs.dart b/packages/stream_chat_flutter/lib/src/utils/typedefs.dart index f588e04c5..46db65348 100644 --- a/packages/stream_chat_flutter/lib/src/utils/typedefs.dart +++ b/packages/stream_chat_flutter/lib/src/utils/typedefs.dart @@ -136,7 +136,7 @@ typedef AttachmentThumbnailBuilder = Widget Function( Attachment, ); -/// {@macro mentionTileBuilder} +/// {@template mentionTileBuilder} /// A widget builder for representing a custom mention tile. /// {@endtemplate} typedef MentionTileBuilder = Widget Function(