chore: fix formatting
This commit is contained in:
@@ -7,11 +7,12 @@ import 'package:stream_chat/stream_chat.dart';
|
|||||||
|
|
||||||
part 'own_user.g.dart';
|
part 'own_user.g.dart';
|
||||||
|
|
||||||
/// The class that defines the own user model
|
/// The class that defines the own user model.
|
||||||
/// This object can be found in [Event]
|
///
|
||||||
|
/// This object can be found in [Event].
|
||||||
@JsonSerializable(createToJson: false)
|
@JsonSerializable(createToJson: false)
|
||||||
class OwnUser extends User {
|
class OwnUser extends User {
|
||||||
/// Constructor used for json serialization
|
/// Constructor used for json serialization.
|
||||||
OwnUser({
|
OwnUser({
|
||||||
this.devices = const [],
|
this.devices = const [],
|
||||||
this.mutes = const [],
|
this.mutes = const [],
|
||||||
@@ -45,11 +46,11 @@ class OwnUser extends User {
|
|||||||
language: language,
|
language: language,
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Create a new instance from a json
|
/// Create a new instance from json.
|
||||||
factory OwnUser.fromJson(Map<String, dynamic> json) => _$OwnUserFromJson(
|
factory OwnUser.fromJson(Map<String, dynamic> json) => _$OwnUserFromJson(
|
||||||
Serializer.moveToExtraDataFromRoot(json, topLevelFields));
|
Serializer.moveToExtraDataFromRoot(json, topLevelFields));
|
||||||
|
|
||||||
/// Create a new instance from [User] object
|
/// Create a new instance from [User] object.
|
||||||
factory OwnUser.fromUser(User user) => OwnUser(
|
factory OwnUser.fromUser(User user) => OwnUser(
|
||||||
id: user.id,
|
id: user.id,
|
||||||
role: user.role,
|
role: user.role,
|
||||||
@@ -133,27 +134,28 @@ class OwnUser extends User {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List of user devices
|
/// List of user devices.
|
||||||
@JsonKey(includeIfNull: false, defaultValue: <Device>[])
|
@JsonKey(includeIfNull: false, defaultValue: <Device>[])
|
||||||
final List<Device> devices;
|
final List<Device> devices;
|
||||||
|
|
||||||
/// List of users muted by the user
|
/// List of users muted by the user.
|
||||||
@JsonKey(includeIfNull: false, defaultValue: <Mute>[])
|
@JsonKey(includeIfNull: false, defaultValue: <Mute>[])
|
||||||
final List<Mute> mutes;
|
final List<Mute> mutes;
|
||||||
|
|
||||||
/// List of users muted by the user
|
/// List of users muted by the user.
|
||||||
@JsonKey(includeIfNull: false, defaultValue: <Mute>[])
|
@JsonKey(includeIfNull: false, defaultValue: <Mute>[])
|
||||||
final List<Mute> channelMutes;
|
final List<Mute> channelMutes;
|
||||||
|
|
||||||
/// Total unread messages by the user
|
/// Total unread messages by the user.
|
||||||
@JsonKey(includeIfNull: false, defaultValue: 0)
|
@JsonKey(includeIfNull: false, defaultValue: 0)
|
||||||
final int totalUnreadCount;
|
final int totalUnreadCount;
|
||||||
|
|
||||||
/// Total unread channels by the user
|
/// Total unread channels by the user.
|
||||||
@JsonKey(includeIfNull: false)
|
@JsonKey(includeIfNull: false)
|
||||||
final int? unreadChannels;
|
final int? unreadChannels;
|
||||||
|
|
||||||
/// Known top level fields.
|
/// Known top level fields.
|
||||||
|
///
|
||||||
/// Useful for [Serializer] methods.
|
/// Useful for [Serializer] methods.
|
||||||
static final topLevelFields = [
|
static final topLevelFields = [
|
||||||
'devices',
|
'devices',
|
||||||
|
|||||||
Reference in New Issue
Block a user