From 8fb45ec4d1530361cd2f2008c0ec83c9a339f36a Mon Sep 17 00:00:00 2001 From: groovinchip Date: Thu, 29 Jul 2021 10:50:03 -0400 Subject: [PATCH] chore: rename MessageInputTheme to MessageInputThemeData --- .../lib/src/stream_chat_theme.dart | 8 +++--- .../lib/src/theme/message_input_theme.dart | 28 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart b/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart index 3f9c39fe..c2eb8c85 100644 --- a/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart +++ b/packages/stream_chat_flutter/lib/src/stream_chat_theme.dart @@ -52,7 +52,7 @@ class StreamChatThemeData { ChannelHeaderThemeData? channelHeaderTheme, MessageTheme? otherMessageTheme, MessageTheme? ownMessageTheme, - MessageInputTheme? messageInputTheme, + MessageInputThemeData? messageInputTheme, Widget Function(BuildContext, User)? defaultUserImage, IconThemeData? primaryIconTheme, List? reactionIcons, @@ -165,7 +165,7 @@ class StreamChatThemeData { final MessageTheme otherMessageTheme; /// Theme dedicated to the [MessageInput] widget - final MessageInputTheme messageInputTheme; + final MessageInputThemeData messageInputTheme; /// The widget that will be built when the user image is unavailable final Widget Function(BuildContext, User) defaultUserImage; @@ -197,7 +197,7 @@ class StreamChatThemeData { ChannelHeaderThemeData? channelHeaderTheme, MessageTheme? ownMessageTheme, MessageTheme? otherMessageTheme, - MessageInputTheme? messageInputTheme, + MessageInputThemeData? messageInputTheme, Widget Function(BuildContext, User)? defaultUserImage, IconThemeData? primaryIconTheme, ChannelListHeaderTheme? channelListHeaderTheme, @@ -370,7 +370,7 @@ class StreamChatThemeData { ), ), ), - messageInputTheme: MessageInputTheme( + messageInputTheme: MessageInputThemeData( borderRadius: BorderRadius.circular(20), sendAnimationDuration: const Duration(milliseconds: 300), actionButtonColor: colorTheme.accentPrimary, diff --git a/packages/stream_chat_flutter/lib/src/theme/message_input_theme.dart b/packages/stream_chat_flutter/lib/src/theme/message_input_theme.dart index 1d14c1b9..45f4a6b7 100644 --- a/packages/stream_chat_flutter/lib/src/theme/message_input_theme.dart +++ b/packages/stream_chat_flutter/lib/src/theme/message_input_theme.dart @@ -3,9 +3,9 @@ import 'package:flutter/material.dart'; import 'package:stream_chat_flutter/src/extension.dart'; /// Defines the theme dedicated to the [MessageInput] widget -class MessageInputTheme with Diagnosticable { - /// Returns a new [MessageInputTheme] - const MessageInputTheme({ +class MessageInputThemeData with Diagnosticable { + /// Returns a new [MessageInputThemeData] + const MessageInputThemeData({ this.sendAnimationDuration, this.actionButtonColor, this.sendButtonColor, @@ -56,8 +56,8 @@ class MessageInputTheme with Diagnosticable { /// Border radius of [MessageInput] final BorderRadius? borderRadius; - /// Returns a new [MessageInputTheme] replacing some of its properties - MessageInputTheme copyWith({ + /// Returns a new [MessageInputThemeData] replacing some of its properties + MessageInputThemeData copyWith({ Duration? sendAnimationDuration, Color? inputBackgroundColor, Color? actionButtonColor, @@ -71,7 +71,7 @@ class MessageInputTheme with Diagnosticable { Gradient? idleBorderGradient, BorderRadius? borderRadius, }) => - MessageInputTheme( + MessageInputThemeData( sendAnimationDuration: sendAnimationDuration ?? this.sendAnimationDuration, inputBackgroundColor: inputBackgroundColor ?? this.inputBackgroundColor, @@ -88,13 +88,13 @@ class MessageInputTheme with Diagnosticable { borderRadius: borderRadius ?? this.borderRadius, ); - /// Linearly interpolate from one [MessageInputTheme] to another. - MessageInputTheme lerp( - MessageInputTheme a, - MessageInputTheme b, + /// Linearly interpolate from one [MessageInputThemeData] to another. + MessageInputThemeData lerp( + MessageInputThemeData a, + MessageInputThemeData b, double t, ) => - MessageInputTheme( + MessageInputThemeData( actionButtonColor: Color.lerp(a.actionButtonColor, b.actionButtonColor, t), actionButtonIdleColor: @@ -116,8 +116,8 @@ class MessageInputTheme with Diagnosticable { inputDecoration: a.inputDecoration, ); - /// Merges [this] [MessageInputTheme] with the [other] - MessageInputTheme merge(MessageInputTheme? other) { + /// Merges [this] [MessageInputThemeData] with the [other] + MessageInputThemeData merge(MessageInputThemeData? other) { if (other == null) return this; return copyWith( sendAnimationDuration: other.sendAnimationDuration, @@ -140,7 +140,7 @@ class MessageInputTheme with Diagnosticable { @override bool operator ==(Object other) => identical(this, other) || - other is MessageInputTheme && + other is MessageInputThemeData && runtimeType == other.runtimeType && sendAnimationDuration == other.sendAnimationDuration && sendButtonColor == other.sendButtonColor &&