add messsageinput button color customization options
This commit is contained in:
@@ -1683,8 +1683,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
return IconButton(
|
return IconButton(
|
||||||
icon: StreamSvgIcon.lightning(
|
icon: StreamSvgIcon.lightning(
|
||||||
color: _commandsOverlay != null
|
color: _commandsOverlay != null
|
||||||
? StreamChatTheme.of(context).colorTheme.accentBlue
|
? StreamChatTheme.of(context).channelTheme.actionButtonColor
|
||||||
: StreamChatTheme.of(context).colorTheme.grey,
|
: StreamChatTheme.of(context).channelTheme.actionButtonIdleColor,
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
constraints: BoxConstraints.tightFor(
|
constraints: BoxConstraints.tightFor(
|
||||||
@@ -1721,8 +1721,8 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
return IconButton(
|
return IconButton(
|
||||||
icon: StreamSvgIcon.attach(
|
icon: StreamSvgIcon.attach(
|
||||||
color: _openFilePickerSection
|
color: _openFilePickerSection
|
||||||
? StreamChatTheme.of(context).colorTheme.accentBlue
|
? StreamChatTheme.of(context).channelTheme.actionButtonColor
|
||||||
: StreamChatTheme.of(context).colorTheme.grey,
|
: StreamChatTheme.of(context).channelTheme.actionButtonIdleColor,
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(0),
|
padding: const EdgeInsets.all(0),
|
||||||
constraints: BoxConstraints.tightFor(
|
constraints: BoxConstraints.tightFor(
|
||||||
@@ -1961,7 +1961,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
Widget _buildIdleSendButton(BuildContext context) {
|
Widget _buildIdleSendButton(BuildContext context) {
|
||||||
return StreamSvgIcon(
|
return StreamSvgIcon(
|
||||||
assetName: _getIdleSendIcon(),
|
assetName: _getIdleSendIcon(),
|
||||||
color: StreamChatTheme.of(context).colorTheme.greyGainsboro,
|
color: StreamChatTheme.of(context).channelTheme.sendButtonIdleColor,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1976,7 +1976,7 @@ class MessageInputState extends State<MessageInput> {
|
|||||||
),
|
),
|
||||||
icon: StreamSvgIcon(
|
icon: StreamSvgIcon(
|
||||||
assetName: _getSendIcon(),
|
assetName: _getSendIcon(),
|
||||||
color: StreamChatTheme.of(context).colorTheme.accentBlue,
|
color: StreamChatTheme.of(context).channelTheme.sendButtonColor,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,9 +182,10 @@ class StreamChatThemeData {
|
|||||||
),
|
),
|
||||||
indicatorIconSize: 16.0),
|
indicatorIconSize: 16.0),
|
||||||
channelTheme: ChannelTheme(
|
channelTheme: ChannelTheme(
|
||||||
messageInputButtonIconTheme: IconThemeData(
|
actionButtonColor: colorTheme.accentBlue,
|
||||||
color: accentColor,
|
actionButtonIdleColor: colorTheme.grey,
|
||||||
),
|
sendButtonColor: colorTheme.accentBlue,
|
||||||
|
sendButtonIdleColor: colorTheme.greyGainsboro,
|
||||||
channelHeaderTheme: ChannelHeaderTheme(
|
channelHeaderTheme: ChannelHeaderTheme(
|
||||||
avatarTheme: AvatarTheme(
|
avatarTheme: AvatarTheme(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
@@ -627,36 +628,47 @@ class ChannelTheme {
|
|||||||
/// Theme of the [ChannelHeader] widget
|
/// Theme of the [ChannelHeader] widget
|
||||||
final ChannelHeaderTheme channelHeaderTheme;
|
final ChannelHeaderTheme channelHeaderTheme;
|
||||||
|
|
||||||
/// IconTheme of the send button in [MessageInput]
|
/// Background color of [MessageInput] send button
|
||||||
final IconThemeData messageInputButtonIconTheme;
|
final Color sendButtonColor;
|
||||||
|
|
||||||
/// Theme of the send button in [MessageInput]
|
/// Background color of [MessageInput] action buttons
|
||||||
final ButtonThemeData messageInputButtonTheme;
|
final Color actionButtonColor;
|
||||||
|
|
||||||
|
/// Background color of [MessageInput] send button
|
||||||
|
final Color sendButtonIdleColor;
|
||||||
|
|
||||||
|
/// Background color of [MessageInput] action buttons
|
||||||
|
final Color actionButtonIdleColor;
|
||||||
|
|
||||||
/// Background color of [MessageInput]
|
/// Background color of [MessageInput]
|
||||||
final Color inputBackground;
|
final Color inputBackground;
|
||||||
|
|
||||||
ChannelTheme({
|
ChannelTheme({
|
||||||
this.channelHeaderTheme,
|
this.channelHeaderTheme,
|
||||||
this.messageInputButtonIconTheme,
|
this.actionButtonColor,
|
||||||
this.messageInputButtonTheme,
|
this.sendButtonColor,
|
||||||
|
this.actionButtonIdleColor,
|
||||||
|
this.sendButtonIdleColor,
|
||||||
this.inputBackground,
|
this.inputBackground,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Creates a copy of [ChannelTheme] with specified attributes overridden.
|
/// Creates a copy of [ChannelTheme] with specified attributes overridden.
|
||||||
ChannelTheme copyWith({
|
ChannelTheme copyWith({
|
||||||
ChannelHeaderTheme channelHeaderTheme,
|
ChannelHeaderTheme channelHeaderTheme,
|
||||||
IconThemeData messageInputButtonIconTheme,
|
|
||||||
ButtonThemeData messageInputButtonTheme,
|
|
||||||
Color inputBackground,
|
Color inputBackground,
|
||||||
|
Color actionButtonColor,
|
||||||
|
Color sendButtonColor,
|
||||||
|
Color actionButtonIdleColor,
|
||||||
|
Color sendButtonIdleColor,
|
||||||
}) =>
|
}) =>
|
||||||
ChannelTheme(
|
ChannelTheme(
|
||||||
channelHeaderTheme: channelHeaderTheme ?? this.channelHeaderTheme,
|
channelHeaderTheme: channelHeaderTheme ?? this.channelHeaderTheme,
|
||||||
messageInputButtonIconTheme:
|
|
||||||
messageInputButtonIconTheme ?? this.messageInputButtonIconTheme,
|
|
||||||
messageInputButtonTheme:
|
|
||||||
messageInputButtonTheme ?? this.messageInputButtonTheme,
|
|
||||||
inputBackground: inputBackground ?? this.inputBackground,
|
inputBackground: inputBackground ?? this.inputBackground,
|
||||||
|
actionButtonColor: actionButtonColor ?? this.actionButtonColor,
|
||||||
|
sendButtonColor: sendButtonColor ?? this.sendButtonColor,
|
||||||
|
actionButtonIdleColor:
|
||||||
|
actionButtonIdleColor ?? this.actionButtonIdleColor,
|
||||||
|
sendButtonIdleColor: sendButtonIdleColor ?? this.sendButtonIdleColor,
|
||||||
);
|
);
|
||||||
|
|
||||||
ChannelTheme merge(ChannelTheme other) {
|
ChannelTheme merge(ChannelTheme other) {
|
||||||
@@ -664,11 +676,11 @@ class ChannelTheme {
|
|||||||
return copyWith(
|
return copyWith(
|
||||||
channelHeaderTheme: channelHeaderTheme?.merge(other.channelHeaderTheme) ??
|
channelHeaderTheme: channelHeaderTheme?.merge(other.channelHeaderTheme) ??
|
||||||
other.channelHeaderTheme,
|
other.channelHeaderTheme,
|
||||||
messageInputButtonIconTheme: messageInputButtonIconTheme
|
|
||||||
?.merge(other.messageInputButtonIconTheme) ??
|
|
||||||
other.messageInputButtonIconTheme,
|
|
||||||
messageInputButtonTheme: other.messageInputButtonTheme,
|
|
||||||
inputBackground: other.inputBackground,
|
inputBackground: other.inputBackground,
|
||||||
|
actionButtonColor: other.actionButtonColor,
|
||||||
|
actionButtonIdleColor: other.actionButtonIdleColor,
|
||||||
|
sendButtonColor: other.sendButtonColor,
|
||||||
|
sendButtonIdleColor: other.sendButtonIdleColor,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user