chore: rename MessageInputTheme to MessageInputThemeData

This commit is contained in:
groovinchip
2021-07-29 10:50:03 -04:00
parent 5afc274a6d
commit 8fb45ec4d1
2 changed files with 18 additions and 18 deletions
@@ -52,7 +52,7 @@ class StreamChatThemeData {
ChannelHeaderThemeData? channelHeaderTheme, ChannelHeaderThemeData? channelHeaderTheme,
MessageTheme? otherMessageTheme, MessageTheme? otherMessageTheme,
MessageTheme? ownMessageTheme, MessageTheme? ownMessageTheme,
MessageInputTheme? messageInputTheme, MessageInputThemeData? messageInputTheme,
Widget Function(BuildContext, User)? defaultUserImage, Widget Function(BuildContext, User)? defaultUserImage,
IconThemeData? primaryIconTheme, IconThemeData? primaryIconTheme,
List<ReactionIcon>? reactionIcons, List<ReactionIcon>? reactionIcons,
@@ -165,7 +165,7 @@ class StreamChatThemeData {
final MessageTheme otherMessageTheme; final MessageTheme otherMessageTheme;
/// Theme dedicated to the [MessageInput] widget /// Theme dedicated to the [MessageInput] widget
final MessageInputTheme messageInputTheme; final MessageInputThemeData messageInputTheme;
/// The widget that will be built when the user image is unavailable /// The widget that will be built when the user image is unavailable
final Widget Function(BuildContext, User) defaultUserImage; final Widget Function(BuildContext, User) defaultUserImage;
@@ -197,7 +197,7 @@ class StreamChatThemeData {
ChannelHeaderThemeData? channelHeaderTheme, ChannelHeaderThemeData? channelHeaderTheme,
MessageTheme? ownMessageTheme, MessageTheme? ownMessageTheme,
MessageTheme? otherMessageTheme, MessageTheme? otherMessageTheme,
MessageInputTheme? messageInputTheme, MessageInputThemeData? messageInputTheme,
Widget Function(BuildContext, User)? defaultUserImage, Widget Function(BuildContext, User)? defaultUserImage,
IconThemeData? primaryIconTheme, IconThemeData? primaryIconTheme,
ChannelListHeaderTheme? channelListHeaderTheme, ChannelListHeaderTheme? channelListHeaderTheme,
@@ -370,7 +370,7 @@ class StreamChatThemeData {
), ),
), ),
), ),
messageInputTheme: MessageInputTheme( messageInputTheme: MessageInputThemeData(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
sendAnimationDuration: const Duration(milliseconds: 300), sendAnimationDuration: const Duration(milliseconds: 300),
actionButtonColor: colorTheme.accentPrimary, actionButtonColor: colorTheme.accentPrimary,
@@ -3,9 +3,9 @@ import 'package:flutter/material.dart';
import 'package:stream_chat_flutter/src/extension.dart'; import 'package:stream_chat_flutter/src/extension.dart';
/// Defines the theme dedicated to the [MessageInput] widget /// Defines the theme dedicated to the [MessageInput] widget
class MessageInputTheme with Diagnosticable { class MessageInputThemeData with Diagnosticable {
/// Returns a new [MessageInputTheme] /// Returns a new [MessageInputThemeData]
const MessageInputTheme({ const MessageInputThemeData({
this.sendAnimationDuration, this.sendAnimationDuration,
this.actionButtonColor, this.actionButtonColor,
this.sendButtonColor, this.sendButtonColor,
@@ -56,8 +56,8 @@ class MessageInputTheme with Diagnosticable {
/// Border radius of [MessageInput] /// Border radius of [MessageInput]
final BorderRadius? borderRadius; final BorderRadius? borderRadius;
/// Returns a new [MessageInputTheme] replacing some of its properties /// Returns a new [MessageInputThemeData] replacing some of its properties
MessageInputTheme copyWith({ MessageInputThemeData copyWith({
Duration? sendAnimationDuration, Duration? sendAnimationDuration,
Color? inputBackgroundColor, Color? inputBackgroundColor,
Color? actionButtonColor, Color? actionButtonColor,
@@ -71,7 +71,7 @@ class MessageInputTheme with Diagnosticable {
Gradient? idleBorderGradient, Gradient? idleBorderGradient,
BorderRadius? borderRadius, BorderRadius? borderRadius,
}) => }) =>
MessageInputTheme( MessageInputThemeData(
sendAnimationDuration: sendAnimationDuration:
sendAnimationDuration ?? this.sendAnimationDuration, sendAnimationDuration ?? this.sendAnimationDuration,
inputBackgroundColor: inputBackgroundColor ?? this.inputBackgroundColor, inputBackgroundColor: inputBackgroundColor ?? this.inputBackgroundColor,
@@ -88,13 +88,13 @@ class MessageInputTheme with Diagnosticable {
borderRadius: borderRadius ?? this.borderRadius, borderRadius: borderRadius ?? this.borderRadius,
); );
/// Linearly interpolate from one [MessageInputTheme] to another. /// Linearly interpolate from one [MessageInputThemeData] to another.
MessageInputTheme lerp( MessageInputThemeData lerp(
MessageInputTheme a, MessageInputThemeData a,
MessageInputTheme b, MessageInputThemeData b,
double t, double t,
) => ) =>
MessageInputTheme( MessageInputThemeData(
actionButtonColor: actionButtonColor:
Color.lerp(a.actionButtonColor, b.actionButtonColor, t), Color.lerp(a.actionButtonColor, b.actionButtonColor, t),
actionButtonIdleColor: actionButtonIdleColor:
@@ -116,8 +116,8 @@ class MessageInputTheme with Diagnosticable {
inputDecoration: a.inputDecoration, inputDecoration: a.inputDecoration,
); );
/// Merges [this] [MessageInputTheme] with the [other] /// Merges [this] [MessageInputThemeData] with the [other]
MessageInputTheme merge(MessageInputTheme? other) { MessageInputThemeData merge(MessageInputThemeData? other) {
if (other == null) return this; if (other == null) return this;
return copyWith( return copyWith(
sendAnimationDuration: other.sendAnimationDuration, sendAnimationDuration: other.sendAnimationDuration,
@@ -140,7 +140,7 @@ class MessageInputTheme with Diagnosticable {
@override @override
bool operator ==(Object other) => bool operator ==(Object other) =>
identical(this, other) || identical(this, other) ||
other is MessageInputTheme && other is MessageInputThemeData &&
runtimeType == other.runtimeType && runtimeType == other.runtimeType &&
sendAnimationDuration == other.sendAnimationDuration && sendAnimationDuration == other.sendAnimationDuration &&
sendButtonColor == other.sendButtonColor && sendButtonColor == other.sendButtonColor &&