@@ -118,28 +118,18 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
118
118
bool get isLastMessage =>
119
119
chatController? .initialMessageList.last.id == widget.message.id;
120
120
121
- bool get swipeLeftShouldShowTime =>
122
- featureActiveConfig? .enableSwipeToSeeTime ?? true ;
121
+ bool get swipeLeftShouldShowTime => featureActiveConfig.enableSwipeToSeeTime;
123
122
124
- bool get enableSwipeToReply =>
125
- featureActiveConfig? .enableSwipeToReply ?? true ;
123
+ bool get enableSwipeToReply => featureActiveConfig.enableSwipeToReply;
126
124
127
125
ProfileCircleConfiguration ? get profileCircleConfig =>
128
126
widget.profileCircleConfig;
129
- FeatureActiveConfig ? featureActiveConfig;
130
- ChatController ? chatController;
131
- ChatUser ? currentUser;
132
- int ? maxDuration;
133
127
134
- @override
135
- void didChangeDependencies () {
136
- super .didChangeDependencies ();
137
- if (provide != null ) {
138
- featureActiveConfig = provide! .featureActiveConfig;
139
- chatController = provide! .chatController;
140
- currentUser = provide! .currentUser;
141
- }
142
- }
128
+ FeatureActiveConfig get featureActiveConfig =>
129
+ provide? .featureActiveConfig ?? const FeatureActiveConfig ();
130
+ ChatController ? get chatController => provide? .chatController;
131
+ ChatUser ? get currentUser => provide? .currentUser;
132
+ int ? maxDuration;
143
133
144
134
@override
145
135
Widget build (BuildContext context) {
@@ -193,7 +183,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
193
183
crossAxisAlignment: CrossAxisAlignment .end,
194
184
children: [
195
185
if (! (isMessageBySender || isMessageLastFromSender) &&
196
- (featureActiveConfig? .enableOtherUserProfileAvatar ?? true ))
186
+ (featureActiveConfig.enableOtherUserProfileAvatar))
197
187
ProfileCircle (
198
188
bottomPadding: widget.message.reaction.reactions.isNotEmpty
199
189
? profileCircleConfig? .bottomPadding ?? 15
@@ -234,7 +224,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
234
224
),
235
225
if (isMessageBySender) ...[getReciept ()],
236
226
if (isMessageBySender &&
237
- (featureActiveConfig? .enableCurrentUserProfileAvatar ?? true ))
227
+ (featureActiveConfig.enableCurrentUserProfileAvatar))
238
228
ProfileCircle (
239
229
bottomPadding: widget.message.reaction.reactions.isNotEmpty
240
230
? profileCircleConfig? .bottomPadding ?? 15
@@ -328,7 +318,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
328
318
if (! isMessageBySameSenderAsPrevious &&
329
319
(chatController? .chatUsers.length ?? 0 ) > 1 &&
330
320
! isMessageBySender &&
331
- (featureActiveConfig? .enableOtherUserName ?? true ))
321
+ (featureActiveConfig.enableOtherUserName))
332
322
Padding (
333
323
padding:
334
324
widget.chatBubbleConfig? .inComingChatBubbleConfig? .padding ??
@@ -352,9 +342,8 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
352
342
MessageView (
353
343
outgoingChatBubbleConfig:
354
344
widget.chatBubbleConfig? .outgoingChatBubbleConfig,
355
- isLongPressEnable:
356
- (featureActiveConfig? .enableReactionPopup ?? true ) ||
357
- (featureActiveConfig? .enableReplySnackBar ?? true ),
345
+ isLongPressEnable: (featureActiveConfig.enableReactionPopup) ||
346
+ (featureActiveConfig.enableReplySnackBar),
358
347
inComingChatBubbleConfig:
359
348
widget.chatBubbleConfig? .inComingChatBubbleConfig,
360
349
message: widget.message,
@@ -364,7 +353,7 @@ class _ChatBubbleWidgetState extends State<ChatBubbleWidget> {
364
353
chatBubbleMaxWidth: widget.chatBubbleConfig? .maxWidth,
365
354
longPressAnimationDuration:
366
355
widget.chatBubbleConfig? .longPressAnimationDuration,
367
- onDoubleTap: featureActiveConfig? .enableDoubleTapToLike ?? false
356
+ onDoubleTap: featureActiveConfig.enableDoubleTapToLike
368
357
? widget.chatBubbleConfig? .onDoubleTap ??
369
358
(message) => currentUser != null
370
359
? chatController? .setReaction (
0 commit comments