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,
MessageTheme? otherMessageTheme,
MessageTheme? ownMessageTheme,
MessageInputTheme? messageInputTheme,
MessageInputThemeData? messageInputTheme,
Widget Function(BuildContext, User)? defaultUserImage,
IconThemeData? primaryIconTheme,
List<ReactionIcon>? 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,
@@ -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 &&