mobile_skt/lib/widgets/core/sk_avatar.dart

29 lines
1023 B
Dart

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(
borderRadius: const BorderRadius.all(Radius.circular(40)),
child: Container(
decoration: BoxDecoration(
border: Border.all(color: AppTheme.dividerColor),
borderRadius: const BorderRadius.all(Radius.circular(40))),
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)),
),
);
}
}