Merge branch 'master' into feature/partial-update

This commit is contained in:
Salvatore Giordano
2021-02-19 10:08:44 +01:00
committed by GitHub
6 changed files with 97 additions and 78 deletions
@@ -1,3 +1,8 @@
## 1.1.1-beta
- Added MessageInput button color customization options
- Fixed author theme and messageinput background
## 1.1.0-beta ## 1.1.0-beta
- Update stream_chat_core dependency - Update stream_chat_core dependency
@@ -596,7 +596,7 @@ class _MessageActionsModalState extends State<MessageActionsModal> {
elevation: 2, elevation: 2,
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
isScrollControlled: true, isScrollControlled: true,
backgroundColor: StreamChatTheme.of(context).colorTheme.white, backgroundColor: StreamChatTheme.of(context).channelTheme.inputBackground,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(16), topLeft: Radius.circular(16),
@@ -234,64 +234,66 @@ class MessageInputState extends State<MessageInput> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget child = SafeArea( Widget child = Container(
child: GestureDetector( color: StreamChatTheme.of(context).channelTheme.inputBackground,
onPanUpdate: (details) { child: SafeArea(
if (details.delta.dy > 0) { child: GestureDetector(
_focusNode.unfocus(); onPanUpdate: (details) {
if (_openFilePickerSection) { if (details.delta.dy > 0) {
setState(() { _focusNode.unfocus();
_openFilePickerSection = false; if (_openFilePickerSection) {
}); setState(() {
_openFilePickerSection = false;
});
}
} }
} },
}, child: Column(
child: Column( mainAxisSize: MainAxisSize.min,
mainAxisSize: MainAxisSize.min, children: [
children: [ if (_hasQuotedMessage)
if (_hasQuotedMessage) Padding(
Padding( padding: const EdgeInsets.fromLTRB(8, 8, 8, 0),
padding: const EdgeInsets.fromLTRB(8, 8, 8, 0), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Padding(
Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: StreamSvgIcon.reply(
child: StreamSvgIcon.reply( color: StreamChatTheme.of(context)
color: StreamChatTheme.of(context) .colorTheme
.colorTheme .greyGainsboro,
.greyGainsboro, ),
), ),
), Text(
Text( 'Reply to Message',
'Reply to Message', style: TextStyle(fontWeight: FontWeight.bold),
style: TextStyle(fontWeight: FontWeight.bold), ),
), IconButton(
IconButton( visualDensity: VisualDensity.compact,
visualDensity: VisualDensity.compact, icon: StreamSvgIcon.closeSmall(),
icon: StreamSvgIcon.closeSmall(), onPressed: widget.onQuotedMessageCleared,
onPressed: widget.onQuotedMessageCleared, ),
), ],
], ),
), ),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: _buildTextField(context),
),
if (widget.parentMessage != null)
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: const EdgeInsets.all(8.0),
child: _buildDmCheckbox(), child: _buildTextField(context),
), ),
_buildFilePickerSection(), if (widget.parentMessage != null)
], Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: _buildDmCheckbox(),
),
_buildFilePickerSection(),
],
),
), ),
), ),
); );
if (widget.editMessage == null) { if (widget.editMessage == null) {
child = Material( child = Material(
color: StreamChatTheme.of(context).colorTheme.white,
elevation: 8, elevation: 8,
child: child, child: child,
); );
@@ -1681,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(
@@ -1719,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(
@@ -1959,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,
); );
} }
@@ -1974,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,
), ),
); );
} }
@@ -578,9 +578,7 @@ class _MessageWidgetState extends State<MessageWidget>
if (showUsername) if (showUsername)
Text( Text(
widget.message.user.name, widget.message.user.name,
style: widget.messageTheme.replies.copyWith( style: widget.messageTheme.messageAuthor,
color: widget.messageTheme.createdAt.color,
),
), ),
if (showTimeStamp) if (showTimeStamp)
Text( Text(
@@ -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),
@@ -206,6 +207,7 @@ class StreamChatThemeData {
inputBackground: colorTheme.white.withAlpha(12), inputBackground: colorTheme.white.withAlpha(12),
), ),
ownMessageTheme: MessageTheme( ownMessageTheme: MessageTheme(
messageAuthor: textTheme.footnote.copyWith(color: colorTheme.grey),
messageText: textTheme.body, messageText: textTheme.body,
createdAt: textTheme.footnote.copyWith(color: colorTheme.grey), createdAt: textTheme.footnote.copyWith(color: colorTheme.grey),
replies: textTheme.footnoteBold.copyWith(color: accentColor), replies: textTheme.footnoteBold.copyWith(color: accentColor),
@@ -231,6 +233,7 @@ class StreamChatThemeData {
reactionsMaskColor: colorTheme.whiteSnow, reactionsMaskColor: colorTheme.whiteSnow,
messageText: textTheme.body, messageText: textTheme.body,
createdAt: textTheme.footnote.copyWith(color: colorTheme.grey), createdAt: textTheme.footnote.copyWith(color: colorTheme.grey),
messageAuthor: textTheme.footnote.copyWith(color: colorTheme.grey),
replies: textTheme.footnoteBold.copyWith(color: accentColor), replies: textTheme.footnoteBold.copyWith(color: accentColor),
messageLinks: TextStyle( messageLinks: TextStyle(
color: accentColor, color: accentColor,
@@ -625,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) {
@@ -662,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,
); );
} }
} }
+1 -1
View File
@@ -1,7 +1,7 @@
name: stream_chat_flutter name: stream_chat_flutter
homepage: https://github.com/GetStream/stream-chat-flutter homepage: https://github.com/GetStream/stream-chat-flutter
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter. description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
version: 1.1.0-beta version: 1.1.1-beta
repository: https://github.com/GetStream/stream-chat-flutter repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues