diff --git a/CHANGELOG.md b/CHANGELOG.md index 4778f4c28..1e9b96422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/example/ios/Flutter/.last_build_id b/example/ios/Flutter/.last_build_id index 8aba77879..20c7c5147 100644 --- a/example/ios/Flutter/.last_build_id +++ b/example/ios/Flutter/.last_build_id @@ -1 +1 @@ -bb5f9103d9045cd6244bcae1f5f343e5 \ No newline at end of file +c3e639ccf9b069e37a7d1345194e6b99 \ No newline at end of file diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index f17b1bc27..c8b16a2bc 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -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): @@ -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 @@ -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 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 0ba6b8279..ca7507799 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -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" diff --git a/lib/src/message_input.dart b/lib/src/message_input.dart index 6836d4661..b30028e84 100644 --- a/lib/src/message_input.dart +++ b/lib/src/message_input.dart @@ -263,13 +263,15 @@ class MessageInputState extends State { }, 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, ), ), diff --git a/lib/src/stream_chat.dart b/lib/src/stream_chat.dart index bff3c9f7a..f5b91349c 100644 --- a/lib/src/stream_chat.dart +++ b/lib/src/stream_chat.dart @@ -116,6 +116,7 @@ class StreamChatState extends State with WidgetsBindingObserver { inputGradient: themeData?.channelTheme?.inputGradient, messageInputButtonTheme: themeData?.channelTheme?.messageInputButtonTheme, + messageInputDecoration: themeData?.channelTheme?.messageInputDecoration, ), ownMessageTheme: defaultTheme.ownMessageTheme.copyWith( replies: themeData?.ownMessageTheme?.replies, diff --git a/lib/src/stream_chat_theme.dart b/lib/src/stream_chat_theme.dart index 851e4a9cb..5af16cab5 100644 --- a/lib/src/stream_chat_theme.dart +++ b/lib/src/stream_chat_theme.dart @@ -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( @@ -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, ), @@ -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. @@ -369,6 +381,7 @@ class ChannelTheme { ButtonThemeData messageInputButtonTheme, Gradient inputGradient, Color inputBackground, + InputDecoration messageInputDecoration, }) => ChannelTheme( channelHeaderTheme: channelHeaderTheme?.copyWith( @@ -386,6 +399,8 @@ class ChannelTheme { messageInputButtonTheme ?? this.messageInputButtonTheme, inputGradient: inputGradient ?? this.inputGradient, inputBackground: inputBackground ?? this.inputBackground, + messageInputDecoration: + messageInputDecoration ?? this.messageInputDecoration, ); } diff --git a/pubspec.yaml b/pubspec.yaml index 583874c2b..5304c039b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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