Closed ckc64 closed 2 months ago
The same
Thank for opening this issue, I am investigating.
@ckc64 can you please try to use the following instead?
StreamChat(
useMaterial3: true,
client: widget.client,
- streamChatThemeData: StreamChatThemeData(
+ streamChatConfigData: StreamChatConfigurationData(
reactionIcons: riveStreamReactionAnimations
.map(
(reaction) => StreamReactionIcon(
type: reaction.type,
builder: (context, highlighted, size) {
return KeyedSubtree(
key: ValueKey('reaction-${reaction.type}'),
child: RiveAnimation.asset(
'assets/stream_reactions.riv',
artboard: highlighted
? reaction.artboardHighlighted
: reaction.artboard,
),
);
},
),
)
.toList(),
),
Helloo, I already solve this issue , transferred the Stream chat to the root material app Thank you
I'm facing the same problem. I want the chat API to be included in this project.
@ckc64 @esarbanis @Ssiswent i'm facing this same issue . can you please suggest how can i fix it?
@ckc64 @esarbanis @Ssiswent i'm facing this same issue . can you please suggest how can i fix it? something like this
Widget build(BuildContext context) { return StreamChatTheme( data: StreamChatThemeData( reactionIcons: riveStreamReactionAnimations .map( (reaction) => StreamReactionIcon( type: reaction.type, builder: (context, highlighted, size) { return KeyedSubtree( key: ValueKey('reaction-${reaction.type}'), child: RiveAnimation.asset( 'assets/stream_reactions.riv', artboard: highlighted ? reaction.artboardHighlighted : reaction.artboard, ), ); }, ), ) .toList(), ), child: StreamChannel( channel: widget.channel, child: Scaffold( ... ...
@ckc64 I need to include this as a feature in my long running project and i need this fix ASAP>
This is the code
`import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:monkee_v2/admin_screens/shared_widgets/form_submit_buttons.dart'; import 'package:monkee_v2/constants/app_constants.dart'; import 'package:monkee_v2/shared_widgets/text_and_description_widget.dart'; import 'package:monkee_v2/shared_widgets/utils/ui_util.dart'; import 'package:monkee_v2/themes.dart'; import 'package:stream_chat_flutter/stream_chat_flutter.dart';
class StreamChatPage extends StatefulWidget { final StreamChatClient client; const StreamChatPage({ super.key, required this.client, });
@override StreamChatPageState createState() => StreamChatPageState(); }
class StreamChatPageState extends State
StreamChatPageState();
@override void dispose() { channel.stopWatching(); channel.dispose(); super.dispose(); }
@override void initState() { super.initState(); channel = widget.client.channel( 'messaging', id: 'flutterDevs', );
// _init();
}
// Future
Widget build(BuildContext context) { var theme = StreamChatThemeData( // reactionIcons: riveStreamReactionAnimations // .map( // (reaction) => StreamReactionIcon( // type: reaction.type, // builder: (context, highlighted, size) { // return KeyedSubtree( // key: ValueKey('reaction-${reaction.type}'), // child: RiveAnimation.asset( // 'assets/stream_reactions.riv', // artboard: highlighted // ? reaction.artboardHighlighted // : reaction.artboard, // ), // ); // }, // ), // ) // .toList(), ); return StreamChatTheme( data: theme, child: StreamChat( client: widget.client, streamChatThemeData: theme, useMaterial3: true, child: StreamChannel( channel: channel, child: ChannelPage(channel), ), ), ); } }
class ChannelPage extends StatefulWidget { final Channel channel;
const ChannelPage(this.channel);
@override _ChannelPageState createState() => _ChannelPageState(); }
class _ChannelPageState extends State
// onMessageTap: (message) {
// showModalBottomSheet(
// context: context,
// builder: (context) {
// return ReactionPicker(
// message: message,
// onReactionTap: (reactionType) async {
// await widget.channel.sendReaction(
// message,
// reactionType,
// );
// Navigator.of(context).pop();
// },
// );
// },
// );
// },
// messageBuilder: (p0, p1, p2, defaultMessageWidget) {
// if (p1.message.isDeleted) return SizedBox();
// return InkWell(
// // onDoubleTap: () async {
// // var status = await channel.unbanMember(
// // 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoicDJZMFVvenI0N09ETFVEdmcyQmh0cnRNV1dqMiJ9.ky0c5iEZIMAh72PwxWKBj3Efr2pjgvgM3507m7qol44',
// // // BanUserRequest(
// // // timeout: 60, // Ban duration in minutes, omit or set to 0 for permanent ban
// // // reason: 'Violation of community guidelines',
// // // ),
// // );
// // status;
// // },
// // onLongPress: () async {
// // var status = await channel.banMember(
// // 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoicDJZMFVvenI0N09ETFVEdmcyQmh0cnRNV1dqMiJ9.ky0c5iEZIMAh72PwxWKBj3Efr2pjgvgM3507m7qol44',
// // {
// // 'ttl': 18,
// // },
// // // BanUserRequest(
// // // timeout: 60, // Ban duration in minutes, omit or set to 0 for permanent ban
// // // reason: 'Violation of community guidelines',
// // // ),
// // );
// // status;
// // },
// // onTap: () {
// // showModalBottomSheet(
// // context: context,
// // builder: (context) {
// // return ReactionPicker(
// // message: p1.message,
// // onReactionTap: (reactionType) async {
// // await channel.sendReaction(
// // p1.message,
// // reactionType,
// // );
// // Navigator.of(context).pop();
// // },
// // );
// // },
// // );
// // },
// child: Row(
// children: [
// Text(p1.message.text ?? 'am,s'),
// IconButton(
// icon: Icon(Icons.delete),
// onPressed: () {
// widget.channel.deleteMessage(p1.message, hard: true);
// setState(() {});
// },
// ),
// IconButton(
// icon: Icon(Icons.edit),
// onPressed: () async {
// await Get.dialog(SetSupplierNameDialog(
// 'Edit your company name ',
// p1.message.text!,
// 'You can change your company name. This will be updated on all your open and submitted bids.',
// (old, newA) {
// var newMessage = Message(
// text: p1.message.text,
// user: p1.message.user,
// );
// // p1.message.text = newA;
// widget.channel.updateMessage(p1.message);
// }));
// },
// ),
// IconButton(
// icon: Icon(Icons.stop_circle),
// onPressed: () {
// widget.channel.banMember(
// p1.message.user!.id,
// {'reason': 'myChoice'},
// );
// setState(() {});
// },
// ),
// IconButton(
// icon: Icon(Icons.pause),
// onPressed: () {
// widget.channel.removeMembers([p1.message.user!.id]);
// setState(() {});
// },
// ),
// ],
// ),
// );
// },
),
),
const StreamMessageInput(
allowedAttachmentPickerTypes: [AttachmentPickerType.files],
),
],
),
);
} } `
Which packages are you using?
stream_chat, stream_chat_flutter, stream_chat_flutter_core
On what platforms did you experience the issue?
Web
What version are you using?
7.2.0-hotfix.1 7.2.0-hotfix.1 7.2.0-hotfix.1
What happened?
I want to show reactions on my message bubble, I already added the StreamChatThemeData but everytime I tried to long press any message bubble it showing an error : stream_chat_theme.dart: 27:7 streamChatTheme != null 'You must have a Stream Chat Theme widget at the top of your widget tree'
Steps to reproduce
Supporting info to reproduce
This is my main chat
Rive file
Relevant log output
No response
Flutter analyze output
Flutter doctor output
Code of Conduct