Solian/lib/widgets/account/account_avatar.dart
2024-05-18 18:17:16 +08:00

21 lines
593 B
Dart

import 'package:flutter/material.dart';
import 'package:solian/services.dart';
class AccountAvatar extends StatelessWidget {
final String content;
final Color? color;
final double? radius;
const AccountAvatar({super.key, required this.content, this.color, this.radius});
@override
Widget build(BuildContext context) {
final direct = content.startsWith('http');
return CircleAvatar(
radius: radius,
backgroundColor: color,
backgroundImage: NetworkImage(direct ? content : '${ServiceFinder.services['paperclip']}/api/attachments/$content'),
);
}
}