Skip to content

Commit

Permalink
Fixes after PR
Browse files Browse the repository at this point in the history
  • Loading branch information
demchenkoalex committed Jan 16, 2022
1 parent f73eccb commit f4ff7f8
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 121 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,4 @@ app.*.symbols
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!**/ios/**/Podfile.lock
2 changes: 1 addition & 1 deletion .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: cf4400006550b70f28e4b4af815151d1e74846c6
revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b
channel: stable

project_type: package
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.5.4

- **BREAKING CHANGE**: Rename `inputPadding` theme key to `inputMargin` (outer insets) and add `inputPadding` (inner insets, previously were hardcoded)
- **BREAKING CHANGE**: Add `BuildContext` as a first parameter for `onMessageLongPress`, `onMessageStatusLongPress`, `onMessageStatusTap`, `onMessageTap`. Thanks @leeyisoft for the PR!
- Add `inputContainerDecoration` to the theme
- Remove keyboard shortuts from Android and iOS platforms. Thanks @kyoungsongKim for reporting!
- Use utf8 codec to parse chinese symbols in link preview. Thanks @minchemo for reporting!
- Update dependencies. Requires Dart >= 2.15.1.

## 1.5.3

- Remove image blur
Expand Down
2 changes: 1 addition & 1 deletion example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: cf4400006550b70f28e4b4af815151d1e74846c6
revision: 77d935af4db863f6abd0b9c31c7e6df2a13de57b
channel: stable

project_type: app
12 changes: 6 additions & 6 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ PODS:
- Flutter
- open_file (0.0.1):
- Flutter
- SDWebImage (5.12.1):
- SDWebImage/Core (= 5.12.1)
- SDWebImage/Core (5.12.1)
- SwiftyGif (5.4.1)
- SDWebImage (5.12.2):
- SDWebImage/Core (= 5.12.2)
- SDWebImage/Core (5.12.2)
- SwiftyGif (5.4.2)
- url_launcher_ios (0.0.1):
- Flutter

Expand Down Expand Up @@ -78,8 +78,8 @@ SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
image_picker: 9aa50e1d8cdacdbed739e925b7eea16d014367e6
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
SDWebImage: 4dc3e42d9ec0c1028b960a33ac6b637bb432207b
SwiftyGif: 6895c887f5551618a3c5dd3ecb512419105bacca
SDWebImage: 240e5c12b592fb1268c1d03b8c90d90e8c2ffe82
SwiftyGif: dec758a9dd3d278e5a855dbf279bf062c923c387
url_launcher_ios: 02f1989d4e14e998335b02b67a7590fa34f971af

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.14.0 <3.0.0"
sdk: ">=2.15.1 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand All @@ -34,7 +34,7 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.4
file_picker: ^4.2.7
file_picker: ^4.3.2
flutter_chat_ui:
path: ../
image_picker: ^0.8.4+4
Expand Down
24 changes: 20 additions & 4 deletions lib/src/chat_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ abstract class ChatTheme {
required this.errorIcon,
required this.inputBackgroundColor,
required this.inputBorderRadius,
this.inputContainerDecoration,
required this.inputPadding,
required this.inputMargin,
required this.inputTextColor,
this.inputTextCursorColor,
required this.inputTextDecoration,
Expand Down Expand Up @@ -125,9 +127,15 @@ abstract class ChatTheme {
/// Top border radius of the bottom bar where text field is
final BorderRadius inputBorderRadius;

/// Insets of the bottom bar where text field is
/// Decoration of the container wrapping the text field
final Decoration? inputContainerDecoration;

/// Inner insets of the bottom bar where text field is
final EdgeInsetsGeometry inputPadding;

/// Outer insets of the bottom bar where text field is
final EdgeInsetsGeometry inputMargin;

/// Color of the text field's text and attachment/send buttons
final Color inputTextColor;

Expand Down Expand Up @@ -260,7 +268,9 @@ class DefaultChatTheme extends ChatTheme {
BorderRadius inputBorderRadius = const BorderRadius.vertical(
top: Radius.circular(20),
),
EdgeInsetsGeometry inputPadding = EdgeInsets.zero,
Decoration? inputContainerDecoration,
EdgeInsetsGeometry inputPadding = const EdgeInsets.fromLTRB(24, 20, 24, 20),
EdgeInsetsGeometry inputMargin = EdgeInsets.zero,
Color inputTextColor = neutral7,
Color? inputTextCursorColor,
InputDecoration inputTextDecoration = const InputDecoration(
Expand Down Expand Up @@ -360,7 +370,9 @@ class DefaultChatTheme extends ChatTheme {
errorIcon: errorIcon,
inputBackgroundColor: inputBackgroundColor,
inputBorderRadius: inputBorderRadius,
inputContainerDecoration: inputContainerDecoration,
inputPadding: inputPadding,
inputMargin: inputMargin,
inputTextColor: inputTextColor,
inputTextCursorColor: inputTextCursorColor,
inputTextDecoration: inputTextDecoration,
Expand Down Expand Up @@ -428,7 +440,9 @@ class DarkChatTheme extends ChatTheme {
BorderRadius inputBorderRadius = const BorderRadius.vertical(
top: Radius.circular(20),
),
Decoration? inputContainerDecoration,
EdgeInsetsGeometry inputPadding = EdgeInsets.zero,
EdgeInsetsGeometry inputMargin = const EdgeInsets.fromLTRB(24, 20, 24, 20),
Color inputTextColor = neutral7,
Color? inputTextCursorColor,
InputDecoration inputTextDecoration = const InputDecoration(
Expand Down Expand Up @@ -528,14 +542,16 @@ class DarkChatTheme extends ChatTheme {
errorIcon: errorIcon,
inputBackgroundColor: inputBackgroundColor,
inputBorderRadius: inputBorderRadius,
messageInsetsHorizontal: messageInsetsHorizontal,
messageInsetsVertical: messageInsetsVertical,
inputContainerDecoration: inputContainerDecoration,
inputPadding: inputPadding,
inputMargin: inputMargin,
inputTextColor: inputTextColor,
inputTextCursorColor: inputTextCursorColor,
inputTextDecoration: inputTextDecoration,
inputTextStyle: inputTextStyle,
messageBorderRadius: messageBorderRadius,
messageInsetsHorizontal: messageInsetsHorizontal,
messageInsetsVertical: messageInsetsVertical,
primaryColor: primaryColor,
receivedEmojiMessageTextStyle: receivedEmojiMessageTextStyle,
receivedMessageBodyTextStyle: receivedMessageBodyTextStyle,
Expand Down
11 changes: 6 additions & 5 deletions lib/src/widgets/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,14 @@ class Chat extends StatefulWidget {
final double? onEndReachedThreshold;

/// See [Message.onMessageLongPress]
final void Function(BuildContext content, types.Message)? onMessageLongPress;
final void Function(BuildContext context, types.Message)? onMessageLongPress;

/// See [Message.onMessageStatusLongPress]
final void Function(types.Message)? onMessageStatusLongPress;
final void Function(BuildContext context, types.Message)?
onMessageStatusLongPress;

/// See [Message.onMessageStatusTap]
final void Function(types.Message)? onMessageStatusTap;
final void Function(BuildContext context, types.Message)? onMessageStatusTap;

/// See [Message.onMessageTap]
final void Function(BuildContext context, types.Message)? onMessageTap;
Expand Down Expand Up @@ -370,13 +371,13 @@ class _ChatState extends State<Chat> {
onMessageLongPress: widget.onMessageLongPress,
onMessageStatusLongPress: widget.onMessageStatusLongPress,
onMessageStatusTap: widget.onMessageStatusTap,
onMessageTap: (content, tappedMessage) {
onMessageTap: (context, tappedMessage) {
if (tappedMessage is types.ImageMessage &&
widget.disableImageGallery != true) {
_onImagePressed(tappedMessage);
}

widget.onMessageTap?.call(content, tappedMessage);
widget.onMessageTap?.call(context, tappedMessage);
},
onPreviewDataFetched: _onPreviewDataFetched,
roundBorder: map['nextMessageInGroup'] == true,
Expand Down
Loading

0 comments on commit f4ff7f8

Please sign in to comment.