Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# ChatView Utility
# ChatView Utils

[![Build](https://github.com/SimformSolutionsPvtLtd/chatview_utility/actions/workflows/flutter.yaml/badge.svg?branch=master)](https://github.com/SimformSolutionsPvtLtd/chatview_utility/actions) [![chatview_utility](https://img.shields.io/pub/v/chatview_utility?label=chatview_utility)](https://pub.dev/packages/chatview_utility)
[![Build](https://github.com/SimformSolutionsPvtLtd/chatview_utils/actions/workflows/flutter.yaml/badge.svg?branch=master)](https://github.com/SimformSolutionsPvtLtd/chatview_utils/actions) [![chatview_utils](https://img.shields.io/pub/v/chatview_utils?label=chatview_utils)](https://pub.dev/packages/chatview_utils)

This is a utility library for the [chatview](https://pub.dev/packages/chatview)
and [chatview_db_connection](https://pub.dev/packages/chatview_db_connection) libraries, containing
and [chatview_connect](https://pub.dev/packages/chatview_connect) libraries, containing
shared type declarations. It should not be used directly.

_Check out other amazing
open-source [Flutter libraries](https://simform-flutter-packages.web.app)
and [Mobile libraries](https://github.com/SimformSolutionsPvtLtd/Awesome-Mobile-Libraries) developed
by Simform Solutions!_

## License

[MIT](LICENSE)
12 changes: 6 additions & 6 deletions example/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:developer';

import 'package:chatview_utility/chatview_utility.dart';
import 'package:chatview_utils/chatview_utils.dart';

void main() {
// Create sample users
Expand All @@ -10,7 +10,7 @@ void main() {
profilePhoto: Constants.profileImage,
);

log(currentUser.toString(), name: 'ChatView Utility');
log(currentUser.toString(), name: 'ChatView Utils');

const otherUsers = [
ChatUser(
Expand All @@ -20,7 +20,7 @@ void main() {
),
];

log(otherUsers.map((e) => e.toString()).toString(), name: 'ChatView Utility');
log(otherUsers.map((e) => e.toString()).toString(), name: 'ChatView Utils');

// Create some initial messages
final messages = [
Expand All @@ -40,15 +40,15 @@ void main() {
),
];

log(messages.map((e) => e.toString()).toString(), name: 'ChatView Utility');
log(messages.map((e) => e.toString()).toString(), name: 'ChatView Utils');

// Demonstrate reaction
final reaction = Reaction(
reactedUserIds: [currentUser.id],
reactions: ['👍'],
);

log(reaction.toString(), name: 'ChatView Utility');
log(reaction.toString(), name: 'ChatView Utils');

// Demonstrate reply
final replyMessage = Message(
Expand All @@ -65,5 +65,5 @@ void main() {
replyBy: currentUser.id,
),
);
log(replyMessage.toString(), name: 'ChatView Utility');
log(replyMessage.toString(), name: 'ChatView Utils');
}
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies:
flutter:
sdk: flutter

chatview_utility:
chatview_utils:
path: ..

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion lib/chatview_utility.dart → lib/chatview_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library chatview_utility;
library chatview_utils;

export 'src/controller/chat_controller.dart';
export 'src/models/models.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/data_models/chat_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ChatUser {

/// Field to define image type.
///
/// {@macro chatview_utility.enumeration.ImageType}
/// {@macro chatview_utils.enumeration.ImageType}
final ImageType imageType;

/// Error builder to build error widget for asset image
Expand Down
4 changes: 2 additions & 2 deletions lib/src/models/data_models/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Message {

/// Represents the type of message.
///
/// {@macro chatview_utility.enumeration.MessageType}
/// {@macro chatview_utils.enumeration.MessageType}
final MessageType messageType;

final DateTime? updateAt;
Expand All @@ -122,7 +122,7 @@ class Message {

/// Provides message's current status.
///
/// {@macro chatview_utility.enumeration.MessageStatus}
/// {@macro chatview_utils.enumeration.MessageStatus}
MessageStatus get status => _status.value;

/// A [ValueListenable] for [MessageStatus] that notifies listeners
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/data_models/reply_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ReplyMessage {

/// Represents the type of reply message.
///
/// {@macro chatview_utility.enumeration.MessageType}
/// {@macro chatview_utils.enumeration.MessageType}
final MessageType messageType;

/// Provides max duration for recorded voice message.
Expand Down
10 changes: 5 additions & 5 deletions lib/src/values/enumeration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* SOFTWARE.
*/

/// {@template chatview_utility.enumeration.MessageType}
/// {@template chatview_utils.enumeration.MessageType}
/// Defines the various message types in ChatView.
/// - [image]: An image message.
/// - [text]: A text message.
Expand Down Expand Up @@ -59,7 +59,7 @@ enum MessageType {
}
}

/// {@template chatview_utility.enumeration.TypeWriterStatus}
/// {@template chatview_utils.enumeration.TypeWriterStatus}
/// Indicates whether the user is currently typing or has finished typing.
/// - [typing]: User is still typing.
/// - [typed]: User has completed typing.
Expand All @@ -73,7 +73,7 @@ enum TypeWriterStatus {
bool get isTyped => this == typed;
}

/// {@template chatview_utility.enumeration.MessageStatus}
/// {@template chatview_utils.enumeration.MessageStatus}
/// Represents the current state of a message from sending to delivery.
/// - [read]: Opened by the recipient.
/// - [delivered]: Successfully delivered.
Expand Down Expand Up @@ -110,7 +110,7 @@ enum MessageStatus {
}
}

/// {@template chatview_utility.enumeration.ImageType}
/// {@template chatview_utils.enumeration.ImageType}
/// Defines the different types of image sources.
/// - [asset]: Image from local assets.
/// - [network]: Image from a network URL.
Expand Down Expand Up @@ -141,7 +141,7 @@ enum ImageType {
}
}

/// {@template chatview_utility.enumeration.ChatViewState}
/// {@template chatview_utils.enumeration.ChatViewState}
/// Represents the different states of the chat view.
/// - [hasMessages]: Chat has messages to display.
/// - [noData]: No messages available.
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: chatview_utility
description: Utility library for the chatview and chatview_db_connection libraries, containing shared type declarations. It should not be used directly.
name: chatview_utils
description: Utility library for the chatview and chatview_connect libraries, containing shared type declarations. It should not be used directly.
version: 0.0.1
repository: https://github.com/SimformSolutionsPvtLtd/chatview_utility
issue_tracker: https://github.com/SimformSolutionsPvtLtd/chatview_utility/issues
repository: https://github.com/SimformSolutionsPvtLtd/chatview_utils
issue_tracker: https://github.com/SimformSolutionsPvtLtd/chatview_utils/issues

environment:
sdk: '>=3.4.0 <4.0.0'
Expand Down