diff --git a/example/lib/example_two/example_two_chat_screen.dart b/example/lib/example_two/example_two_chat_screen.dart index 621add52..961939de 100644 --- a/example/lib/example_two/example_two_chat_screen.dart +++ b/example/lib/example_two/example_two_chat_screen.dart @@ -9,8 +9,8 @@ import '../values/colors.dart'; import '../values/borders.dart'; import '../values/icons.dart'; import '../values/images.dart'; +import '../widgets/custom_chat_bar.dart'; import '../widgets/reply_message_tile.dart'; -import '../widgets/wp_custom_chat_bar.dart'; class ExampleTwoChatScreen extends StatefulWidget { const ExampleTwoChatScreen({required this.chat, super.key}); @@ -175,7 +175,7 @@ class _ExampleTwoChatScreenState extends State { ), chatBackgroundConfig: ChatBackgroundConfiguration( backgroundColor: AppColors.uiTwoBackground, - backgroundImage: AppImages.wpChatBackground, + backgroundImage: AppImages.uiTwoChatBackground, groupSeparatorBuilder: (separator) => _customSeparator(separator), ), chatBubbleConfig: ChatBubbleConfiguration( @@ -282,7 +282,7 @@ class _ExampleTwoChatScreenState extends State { onLeftSwipe: null, onRightSwipe: null, ), - sendMessageBuilder: (replyMessage) => WpCustomChatBar( + sendMessageBuilder: (replyMessage) => CustomChatBar( chatController: _chatController, replyMessage: replyMessage ?? const ReplyMessage(), onAttachPressed: () => ScaffoldMessenger.of(context).showSnackBar( diff --git a/example/lib/values/images.dart b/example/lib/values/images.dart index b93fe83f..4af52f3a 100644 --- a/example/lib/values/images.dart +++ b/example/lib/values/images.dart @@ -1,3 +1,3 @@ class AppImages { - static const String wpChatBackground = "assets/images/chat_background.png"; + static const String uiTwoChatBackground = "assets/images/chat_background.png"; } diff --git a/example/lib/widgets/wp_custom_chat_bar.dart b/example/lib/widgets/custom_chat_bar.dart similarity index 96% rename from example/lib/widgets/wp_custom_chat_bar.dart rename to example/lib/widgets/custom_chat_bar.dart index f3e0a52c..507026a4 100644 --- a/example/lib/widgets/wp_custom_chat_bar.dart +++ b/example/lib/widgets/custom_chat_bar.dart @@ -9,8 +9,8 @@ import 'package:audio_waveforms/audio_waveforms.dart'; import '../../values/colors.dart'; import '../../values/icons.dart'; -class WpCustomChatBar extends StatefulWidget { - const WpCustomChatBar({ +class CustomChatBar extends StatefulWidget { + const CustomChatBar({ required this.chatController, required this.replyMessage, this.onAttachPressed, @@ -22,10 +22,10 @@ class WpCustomChatBar extends StatefulWidget { final VoidCallback? onAttachPressed; @override - State createState() => _WpCustomChatBarState(); + State createState() => _CustomChatBarState(); } -class _WpCustomChatBarState extends State { +class _CustomChatBarState extends State { RecorderController? controller; late ReplyMessage? _replyMessage = widget.replyMessage; final voiceRecordingConfig = const VoiceRecordingConfiguration(); @@ -67,7 +67,10 @@ class _WpCustomChatBarState extends State { padding: const EdgeInsets.fromLTRB(8, 8, 7.5, 7.5), decoration: const BoxDecoration( border: Border( - left: BorderSide(color: AppColors.uiTwoReplyLineColor, width: 4), + left: BorderSide( + color: AppColors.uiTwoReplyLineColor, + width: 4, + ), ), ), child: Row( @@ -258,10 +261,10 @@ class _WpCustomChatBarState extends State { onPressed: _sendMessage, padding: EdgeInsets.zero, style: IconButton.styleFrom( - backgroundColor: AppColors.uiTwoGreen, + backgroundColor: + AppColors.uiTwoGreen, ), - icon: - SvgPicture.asset(AppIcons.send), + icon: SvgPicture.asset(AppIcons.send), ), ), ] @@ -303,8 +306,8 @@ class _WpCustomChatBarState extends State { child: IconButton( onPressed: _recordOrStop, padding: EdgeInsets.zero, - icon: SvgPicture.asset( - AppIcons.mic), + icon: + SvgPicture.asset(AppIcons.mic), ), ), ], diff --git a/lib/src/widgets/chat_view_list/auto_animate_sliver_list.dart b/lib/src/widgets/chat_view_list/auto_animate_sliver_list.dart index c8a12120..18fb5c28 100644 --- a/lib/src/widgets/chat_view_list/auto_animate_sliver_list.dart +++ b/lib/src/widgets/chat_view_list/auto_animate_sliver_list.dart @@ -167,6 +167,7 @@ class AutoAnimateSliverListState extends State> void dispose() { _updateSubscription?.cancel(); _updateSubscription = null; + _controller.disposeAnimations(); super.dispose(); } }