forked from deniscolak/colorize-text-avatar
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more improved version of AvatarOptions
- Loading branch information
Showing
5 changed files
with
22 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.