Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
demchenkoalex committed May 16, 2023
1 parent 45d0b42 commit 8396139
Show file tree
Hide file tree
Showing 23 changed files with 531 additions and 851 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- name: Install dependencies
run: flutter pub get

- run: flutter format . --set-exit-if-changed
- run: dart format . --set-exit-if-changed
- run: flutter analyze --no-pub
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2022 Oleksandr Demchenko
Copyright 2023 Oleksandr Demchenko

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
28 changes: 14 additions & 14 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ class _ChatPageState extends State<ChatPage> {
_loadMessages();
}

@override
Widget build(BuildContext context) => Scaffold(
body: Chat(
messages: _messages,
onAttachmentPressed: _handleAttachmentPressed,
onMessageTap: _handleMessageTap,
onPreviewDataFetched: _handlePreviewDataFetched,
onSendPressed: _handleSendPressed,
showUserAvatars: true,
showUserNames: true,
user: _user,
),
);

void _addMessage(types.Message message) {
setState(() {
_messages.insert(0, message);
Expand Down Expand Up @@ -235,4 +221,18 @@ class _ChatPageState extends State<ChatPage> {
_messages = messages;
});
}

@override
Widget build(BuildContext context) => Scaffold(
body: Chat(
messages: _messages,
onAttachmentPressed: _handleAttachmentPressed,
onMessageTap: _handleMessageTap,
onPreviewDataFetched: _handlePreviewDataFetched,
onSendPressed: _handleSendPressed,
showUserAvatars: true,
showUserNames: true,
user: _user,
),
);
}
16 changes: 8 additions & 8 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.18.0 <3.0.0"
sdk: ">=2.18.0 <4.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 @@ -32,22 +32,22 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.5
file_picker: ^5.2.9
file_picker: ^5.3.0
flutter:
sdk: flutter
flutter_chat_types: ^3.6.0
flutter_chat_types: ^3.6.1
flutter_chat_ui:
path: ../
http: ^0.13.5
image_picker: ^0.8.7+3
intl: ^0.18.0
http: ^0.13.6
image_picker: ^0.8.7+5
intl: ^0.18.1
mime: ^1.0.4
open_filex: ^4.3.2
path_provider: ^2.0.14
path_provider: ^2.0.15
uuid: ^3.0.7

dev_dependencies:
dart_code_metrics: ^4.21.3
dart_code_metrics: ^5.7.3
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
Expand Down
28 changes: 14 additions & 14 deletions lib/src/chat_l10n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class ChatL10n {
class ChatL10nAr extends ChatL10n {
/// Creates Arabic l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nAr({
super.attachmentButtonAccessibilityLabel = 'إرسال الوسائط',
super.emptyChatPlaceholder = 'لا يوجد رسائل هنا بعد',
Expand All @@ -54,7 +54,7 @@ class ChatL10nAr extends ChatL10n {
class ChatL10nDe extends ChatL10n {
/// Creates German l10n. Use this constructor if you want to
/// override only a couple of variables, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nDe({
super.attachmentButtonAccessibilityLabel = 'Medien senden',
super.emptyChatPlaceholder = 'Noch keine Nachrichten',
Expand All @@ -70,7 +70,7 @@ class ChatL10nDe extends ChatL10n {
class ChatL10nEn extends ChatL10n {
/// Creates English l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nEn({
super.attachmentButtonAccessibilityLabel = 'Send media',
super.emptyChatPlaceholder = 'No messages here yet',
Expand All @@ -86,7 +86,7 @@ class ChatL10nEn extends ChatL10n {
class ChatL10nEs extends ChatL10n {
/// Creates Spanish l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nEs({
super.attachmentButtonAccessibilityLabel = 'Enviar multimedia',
super.emptyChatPlaceholder = 'Aún no hay mensajes',
Expand All @@ -102,7 +102,7 @@ class ChatL10nEs extends ChatL10n {
class ChatL10nKo extends ChatL10n {
/// Creates Korean l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nKo({
super.attachmentButtonAccessibilityLabel = '미디어 보내기',
super.emptyChatPlaceholder = '주고받은 메시지가 없습니다',
Expand All @@ -118,7 +118,7 @@ class ChatL10nKo extends ChatL10n {
class ChatL10nPl extends ChatL10n {
/// Creates Polish l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nPl({
super.attachmentButtonAccessibilityLabel = 'Wyślij multimedia',
super.emptyChatPlaceholder = 'Tu jeszcze nie ma wiadomości',
Expand All @@ -134,7 +134,7 @@ class ChatL10nPl extends ChatL10n {
class ChatL10nPt extends ChatL10n {
/// Creates Portuguese l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nPt({
super.attachmentButtonAccessibilityLabel = 'Envia mídia',
super.emptyChatPlaceholder = 'Ainda não há mensagens aqui',
Expand All @@ -150,7 +150,7 @@ class ChatL10nPt extends ChatL10n {
class ChatL10nRu extends ChatL10n {
/// Creates Russian l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nRu({
super.attachmentButtonAccessibilityLabel = 'Отправить медиа',
super.emptyChatPlaceholder = 'Пока что у вас нет сообщений',
Expand All @@ -166,7 +166,7 @@ class ChatL10nRu extends ChatL10n {
class ChatL10nTr extends ChatL10n {
/// Creates Turkish l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nTr({
super.attachmentButtonAccessibilityLabel = 'Medya gönder',
super.emptyChatPlaceholder = 'Henüz mesaj yok',
Expand All @@ -182,7 +182,7 @@ class ChatL10nTr extends ChatL10n {
class ChatL10nUk extends ChatL10n {
/// Creates Ukrainian l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nUk({
super.attachmentButtonAccessibilityLabel = 'Надіслати медіа',
super.emptyChatPlaceholder = 'Повідомлень ще немає',
Expand All @@ -198,7 +198,7 @@ class ChatL10nUk extends ChatL10n {
class ChatL10nZhCN extends ChatL10n {
/// Creates Simplified Chinese l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nZhCN({
super.attachmentButtonAccessibilityLabel = '发送媒体文件',
super.emptyChatPlaceholder = '暂无消息',
Expand All @@ -214,7 +214,7 @@ class ChatL10nZhCN extends ChatL10n {
class ChatL10nZhTW extends ChatL10n {
/// Creates Traditional Chinese l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nZhTW({
super.attachmentButtonAccessibilityLabel = '傳送媒體',
super.emptyChatPlaceholder = '還沒有訊息在這裡',
Expand All @@ -230,7 +230,7 @@ class ChatL10nZhTW extends ChatL10n {
class ChatL10nFi extends ChatL10n {
/// Creates Finnish l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nFi({
super.attachmentButtonAccessibilityLabel = 'Lähetä mediaa',
super.emptyChatPlaceholder = 'Ei viestejä täällä vielä',
Expand All @@ -246,7 +246,7 @@ class ChatL10nFi extends ChatL10n {
class ChatL10nSe extends ChatL10n {
/// Creates Swedish l10n. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatL10n]
/// which extends [ChatL10n].
const ChatL10nSe({
super.attachmentButtonAccessibilityLabel = 'Skicka media',
super.emptyChatPlaceholder = 'Här finns inga meddelanden',
Expand Down
24 changes: 11 additions & 13 deletions lib/src/chat_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'widgets/unread_header.dart';

// For internal usage only. Use values from theme itself.

/// See [ChatTheme.userAvatarNameColors]
/// See [ChatTheme.userAvatarNameColors].
const colors = [
Color(0xffff6767),
Color(0xff66e0da),
Expand Down Expand Up @@ -179,7 +179,7 @@ abstract class ChatTheme {
final double messageInsetsVertical;

/// Primary color of the chat used as a background of sent messages
/// and statuses
/// and statuses.
final Color primaryColor;

/// Text style used for displaying emojis on text messages.
Expand All @@ -194,15 +194,14 @@ abstract class ChatTheme {
final TextStyle? receivedMessageBodyCodeTextStyle;

/// Text style used for displaying link text on received text messages.
/// Defaults to [receivedMessageBodyTextStyle]
/// Defaults to [receivedMessageBodyTextStyle].
final TextStyle? receivedMessageBodyLinkTextStyle;

/// Body text style used for displaying text on different types
/// of received messages
/// of received messages.
final TextStyle receivedMessageBodyTextStyle;

/// Caption text style used for displaying secondary info (e.g. file size)
/// on different types of received messages
/// Caption text style used for displaying secondary info (e.g. file size) on different types of received messages.
final TextStyle receivedMessageCaptionTextStyle;

/// Color of the document icon on received messages. Has no effect when
Expand Down Expand Up @@ -242,15 +241,14 @@ abstract class ChatTheme {
final TextStyle? sentMessageBodyCodeTextStyle;

/// Text style used for displaying link text on sent text messages.
/// Defaults to [sentMessageBodyTextStyle]
/// Defaults to [sentMessageBodyTextStyle].
final TextStyle? sentMessageBodyLinkTextStyle;

/// Body text style used for displaying text on different types
/// of sent messages
/// of sent messages.
final TextStyle sentMessageBodyTextStyle;

/// Caption text style used for displaying secondary info (e.g. file size)
/// on different types of sent messages
/// Caption text style used for displaying secondary info (e.g. file size) on different types of sent messages.
final TextStyle sentMessageCaptionTextStyle;

/// Color of the document icon on sent messages. Has no effect when
Expand Down Expand Up @@ -286,7 +284,7 @@ abstract class ChatTheme {
final List<Color> userAvatarNameColors;

/// Text style used for displaying initials on user avatar if no
/// image is provided
/// image is provided.
final TextStyle userAvatarTextStyle;

/// User names text style. Color will be overwritten with [userAvatarNameColors].
Expand All @@ -298,7 +296,7 @@ abstract class ChatTheme {
class DefaultChatTheme extends ChatTheme {
/// Creates a default chat theme. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatTheme]
/// which extends [ChatTheme].
const DefaultChatTheme({
super.attachmentButtonIcon,
super.attachmentButtonMargin,
Expand Down Expand Up @@ -467,7 +465,7 @@ class DefaultChatTheme extends ChatTheme {
class DarkChatTheme extends ChatTheme {
/// Creates a dark chat theme. Use this constructor if you want to
/// override only a couple of properties, otherwise create a new class
/// which extends [ChatTheme]
/// which extends [ChatTheme].
const DarkChatTheme({
super.attachmentButtonIcon,
super.attachmentButtonMargin,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/conditional/browser_conditional.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BaseConditional createConditional() => BrowserConditional();
/// A conditional for browser.
class BrowserConditional extends BaseConditional {
/// Returns [NetworkImage] if URI starts with http
/// otherwise returns transparent image
/// otherwise returns transparent image.
@override
ImageProvider getProvider(String uri, {Map<String, String>? headers}) {
if (uri.startsWith('http') || uri.startsWith('blob')) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/conditional/io_conditional.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BaseConditional createConditional() => IOConditional();
/// A conditional for anything but browser.
class IOConditional extends BaseConditional {
/// Returns [NetworkImage] if URI starts with http
/// otherwise uses IO to create File
/// otherwise uses IO to create File.
@override
ImageProvider getProvider(String uri, {Map<String, String>? headers}) {
if (uri.startsWith('http')) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ String getUserName(types.User user) =>
'${user.firstName ?? ''} ${user.lastName ?? ''}'.trim();

/// Returns formatted date used as a divider between different days in the
/// chat history
/// chat history.
String getVerboseDateTimeRepresentation(
DateTime dateTime, {
DateFormat? dateFormat,
Expand Down
Loading

0 comments on commit 8396139

Please sign in to comment.