Skip to content

Commit

Permalink
Add room type
Browse files Browse the repository at this point in the history
  • Loading branch information
demchenkoalex committed Mar 13, 2021
1 parent c99f888 commit a2147c3
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.4

- Add Room type

## 2.0.3

- Fix null status
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[![Pub](https://img.shields.io/pub/v/flutter_chat_types)](https://pub.dartlang.org/packages/flutter_chat_types)
[![build](https://github.com/flyerhq/flutter_chat_types/workflows/build/badge.svg)](https://github.com/flyerhq/flutter_chat_types/actions?query=workflow%3Abuild)
[![CodeFactor](https://www.codefactor.io/repository/github/flyerhq/flutter_chat_types/badge)](https://www.codefactor.io/repository/github/flyerhq/flutter_chat_types)
[![pub points](https://badges.bar/sentry/pub%20points)](https://pub.dev/packages/flutter_chat_types/score)

Utility library for the [flutter_chat_ui](https://github.com/flyerhq/flutter_chat_ui) and [flutter_firebase_chat_core](https://github.com/flyerhq/flutter_firebase_chat_core) libraries which contains shared type declarations. Should not be used directly.

Expand Down
1 change: 1 addition & 0 deletions lib/flutter_chat_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ library flutter_chat_types;

export 'src/message.dart';
export 'src/preview_data.dart';
export 'src/room.dart';
export 'src/user.dart';
32 changes: 32 additions & 0 deletions lib/src/room.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:meta/meta.dart';
import 'user.dart';

/// A class that represents a room where 2 or more participants can chat
@immutable
class Room {
/// Creates a [Room]
const Room({
required this.id,
this.imageUrl,
required this.isGroup,
this.name,
required this.users,
});

/// Room's unique ID
final String id;

/// Room's image. In case the room has 2 users - avatar of the second person,
/// otherwise custom image (for a group).
final String? imageUrl;

/// Should be true if more than 2 users are in the room
final bool isGroup;

/// Room's name. In case the room has 2 users - name of the second person,
/// otherwise custom name (for a group).
final String? name;

/// List of users which are in the room
final List<User> users;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flutter_chat_types
description: >
Utility library for the flutter_chat_ui and flutter_firebase_chat_core libraries
which contains shared type declarations.
version: 2.0.3
version: 2.0.4
homepage: https://github.com/flyerhq/flutter_chat_types

environment:
Expand Down

0 comments on commit a2147c3

Please sign in to comment.