Skip to content

Commit

Permalink
Merge pull request #172 from GetStream/feature/messageInputDecoration
Browse files Browse the repository at this point in the history
  • Loading branch information
xsahil03x authored Dec 9, 2020
2 parents ea7c0f1 + 0ca0fd1 commit 5548650
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.17

- Expose messageInputDecoration as part of the theme

## 0.2.16

- Do not wrap channel preview builder. Users will have to implement they're custom onTap/onLongPress implementation
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bb5f9103d9045cd6244bcae1f5f343e5
c3e639ccf9b069e37a7d1345194e6b99
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PODS:
- Firebase/Messaging (6.33.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.1):
- firebase_core (0.5.2-1):
- Firebase/CoreOnly (~> 6.33.0)
- Flutter
- firebase_messaging (7.0.3):
Expand Down Expand Up @@ -227,7 +227,7 @@ SPEC CHECKSUMS:
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: aa25a5dc6b492ecab37587c53d8420135f0cac90
firebase_core: 7423d688a1c6f2f2d859d64ae26991be39989781
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
Expand Down Expand Up @@ -256,8 +256,8 @@ SPEC CHECKSUMS:
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107

PODFILE CHECKSUM: eb001256612a59f8f9e4d083ad8b9671e69dd184

COCOAPODS: 1.10.0.rc.1
COCOAPODS: 1.10.0
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: example
description: A new Flutter project.
version: 1.0.26+27
version: 1.0.27+28

environment:
sdk: ">=2.2.2 <3.0.0"
Expand Down
16 changes: 9 additions & 7 deletions lib/src/message_input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,15 @@ class MessageInputState extends State<MessageInput> {
},
style: widget.inputTextStyle ?? Theme.of(context).textTheme.bodyText2,
autofocus: widget.autofocus,
decoration: InputDecoration(
hintText: 'Write a message',
hintStyle:
widget.inputTextStyle ?? Theme.of(context).textTheme.bodyText2,
prefixText: ' ',
border: InputBorder.none,
),
decoration:
StreamChatTheme.of(context).channelTheme.messageInputDecoration ??
InputDecoration(
hintText: 'Write a message',
hintStyle: widget.inputTextStyle ??
Theme.of(context).textTheme.bodyText2,
prefixText: ' ',
border: InputBorder.none,
),
textCapitalization: TextCapitalization.sentences,
),
),
Expand Down
1 change: 1 addition & 0 deletions lib/src/stream_chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
inputGradient: themeData?.channelTheme?.inputGradient,
messageInputButtonTheme:
themeData?.channelTheme?.messageInputButtonTheme,
messageInputDecoration: themeData?.channelTheme?.messageInputDecoration,
),
ownMessageTheme: defaultTheme.ownMessageTheme.copyWith(
replies: themeData?.ownMessageTheme?.replies,
Expand Down
15 changes: 15 additions & 0 deletions lib/src/stream_chat_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ class StreamChatThemeData {
channelTheme.inputGradient ?? this.channelTheme.inputGradient,
inputBackground: channelTheme.inputBackground ??
this.channelTheme.inputBackground,
messageInputDecoration: channelTheme.messageInputDecoration ??
this.channelTheme.messageInputDecoration,
) ??
this.channelTheme,
ownMessageTheme: ownMessageTheme?.copyWith(
Expand Down Expand Up @@ -247,6 +249,12 @@ class StreamChatThemeData {
),
),
channelTheme: ChannelTheme(
messageInputDecoration: InputDecoration(
hintText: 'Write a message',
hintStyle: theme.textTheme.bodyText2,
prefixText: ' ',
border: InputBorder.none,
),
messageInputButtonIconTheme: theme.iconTheme.copyWith(
color: accentColor,
),
Expand Down Expand Up @@ -354,12 +362,16 @@ class ChannelTheme {
/// Background color of [MessageInput]
final Color inputBackground;

/// InputDecoration of [MessageInput]
final InputDecoration messageInputDecoration;

ChannelTheme({
this.channelHeaderTheme,
this.messageInputButtonIconTheme,
this.messageInputButtonTheme,
this.inputBackground,
this.inputGradient,
this.messageInputDecoration,
});

/// Creates a copy of [ChannelTheme] with specified attributes overridden.
Expand All @@ -369,6 +381,7 @@ class ChannelTheme {
ButtonThemeData messageInputButtonTheme,
Gradient inputGradient,
Color inputBackground,
InputDecoration messageInputDecoration,
}) =>
ChannelTheme(
channelHeaderTheme: channelHeaderTheme?.copyWith(
Expand All @@ -386,6 +399,8 @@ class ChannelTheme {
messageInputButtonTheme ?? this.messageInputButtonTheme,
inputGradient: inputGradient ?? this.inputGradient,
inputBackground: inputBackground ?? this.inputBackground,
messageInputDecoration:
messageInputDecoration ?? this.messageInputDecoration,
);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 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.
version: 0.2.16
version: 0.2.17
repository: https://github.com/GetStream/stream-chat-flutter
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues

Expand Down

0 comments on commit 5548650

Please sign in to comment.