Skip to content

Commit

Permalink
enforce avatarInfo to be non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
gtalha07 committed May 1, 2024
1 parent e9cd467 commit 7ec3b42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/models/avatar_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ import 'package:acter_avatar/acter_avatar.dart';
/// Helper class for defining avatar type.
/// Currently supported modes are Space/Group Chat (default), DM, Group DM.
class AvatarOptions {
// Primary avatar. Having it null would switch to fallback.
AvatarInfo? avatar;
// Secondary group avatars. Having it null would switch to fallback.
// Primary avatar.
AvatarInfo avatar;
// Secondary group avatars. Providing it null would disable it..
List<AvatarInfo>? groupAvatars;
double? size;
double? groupAvatarSize;

/// Default usage .i.e. Space/Group Chat. Group avatars will appear as secondary badges.
AvatarOptions(
{required this.avatar,
required this.groupAvatars,
this.groupAvatars,
this.size,
this.groupAvatarSize});

/// useful for setting DM/Private Chat avatar.
AvatarOptions.DM(this.avatar, {this.size});

/// useful for setting Group DM chat. Group avatars will appear as stacked avatars.
AvatarOptions.GroupDM(this.groupAvatars, {this.groupAvatarSize});
AvatarOptions.GroupDM(this.avatar, this.groupAvatars, {this.groupAvatarSize});
}

0 comments on commit 7ec3b42

Please sign in to comment.