feat: dark mode avatar placeholder

This commit is contained in:
Rongjian Zhang 2021-01-30 15:55:08 +08:00
parent 30eb0ef5b3
commit c1b3d330e0
3 changed files with 5 additions and 2 deletions

BIN
images/avatar-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -17,8 +17,6 @@ class Avatar extends StatelessWidget {
final String linkUrl;
final BorderRadius borderRadius;
static const fallback = 'images/avatar.png';
Avatar({
@required this.url,
this.size = AvatarSize.medium,
@ -28,6 +26,11 @@ class Avatar extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
final fallback = theme.brightness == Brightness.light
? 'images/avatar.png'
: 'images/avatar-dark.png';
final widget = ClipRRect(
borderRadius: borderRadius ?? BorderRadius.circular(size / 2),
child: url == null