2024-04-10 17:08:26 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:sk_base_mobile/app_theme.dart';
|
|
|
|
import 'package:sk_base_mobile/util/media_util.dart';
|
|
|
|
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
|
|
|
|
import 'package:sk_base_mobile/widgets/fade_in_cache_image.dart';
|
|
|
|
|
|
|
|
class SkAvatar extends StatelessWidget {
|
|
|
|
final String? url;
|
|
|
|
const SkAvatar({super.key, this.url});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ClipRRect(
|
2024-04-15 10:59:12 +08:00
|
|
|
borderRadius: BorderRadius.circular(ScreenAdaper.sp(80)),
|
2024-04-10 17:08:26 +08:00
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
2024-04-15 10:59:12 +08:00
|
|
|
color: Colors.grey[200],
|
2024-04-10 17:08:26 +08:00
|
|
|
border: Border.all(color: AppTheme.dividerColor),
|
2024-04-15 10:59:12 +08:00
|
|
|
borderRadius: BorderRadius.circular(ScreenAdaper.sp(80))),
|
2024-04-10 17:08:26 +08:00
|
|
|
child: FadeInCacheImage(
|
|
|
|
defaultWidget: Icon(Icons.person_2_outlined,
|
|
|
|
size: ScreenAdaper.height(60), color: AppTheme.grey),
|
|
|
|
height: ScreenAdaper.height(80),
|
|
|
|
width: ScreenAdaper.height(80),
|
|
|
|
url: MediaUtil.getMediaUrl(url)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|