dart format
This commit is contained in:
@@ -12,7 +12,12 @@ class UserAvatar extends StatefulWidget {
|
||||
final String id;
|
||||
final bool isGroup;
|
||||
final int size;
|
||||
const UserAvatar({required this.id, this.isGroup = false, this.size = 20, super.key});
|
||||
const UserAvatar({
|
||||
required this.id,
|
||||
this.isGroup = false,
|
||||
this.size = 20,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<UserAvatar> createState() => _UserAvatarState();
|
||||
@@ -79,10 +84,12 @@ class _UserAvatarState extends State<UserAvatar> {
|
||||
}
|
||||
|
||||
static bool _looksLikeSvg(Uint8List bytes) {
|
||||
final head = utf8.decode(
|
||||
bytes.sublist(0, bytes.length < 256 ? bytes.length : 256),
|
||||
allowMalformed: true,
|
||||
).trimLeft();
|
||||
final head = utf8
|
||||
.decode(
|
||||
bytes.sublist(0, bytes.length < 256 ? bytes.length : 256),
|
||||
allowMalformed: true,
|
||||
)
|
||||
.trimLeft();
|
||||
return head.startsWith('<?xml') || head.startsWith('<svg');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user