Skip to content

Commit

Permalink
more improved version of AvatarOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gtalha07 committed May 1, 2024
1 parent a90c04c commit e9cd467
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 108 deletions.
28 changes: 22 additions & 6 deletions lib/src/models/avatar_options.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import 'package:acter_avatar/acter_avatar.dart';

/// Abstract class representing the set of avatars.
abstract class AvatarOptions {
AvatarInfo? get avatar;
List<AvatarInfo>? get parentAvatars;
double? get size;
double? get parentSize;
/// 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.
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.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});
}
21 changes: 0 additions & 21 deletions lib/src/models/dm_avatar_options.dart

This file was deleted.

29 changes: 0 additions & 29 deletions lib/src/models/group_chat_avatar_option.dart

This file was deleted.

27 changes: 0 additions & 27 deletions lib/src/models/group_dm_avatar_options.dart

This file was deleted.

25 changes: 0 additions & 25 deletions lib/src/models/space_avatar_options.dart

This file was deleted.

0 comments on commit e9cd467

Please sign in to comment.