mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: default icon for user avatar
This commit is contained in:
parent
435d1b8354
commit
4488247fb1
@ -1,6 +1,7 @@
|
||||
import 'package:app_flowy/startup/startup.dart';
|
||||
import 'package:app_flowy/workspace/application/menu/menu_user_bloc.dart';
|
||||
import 'package:app_flowy/workspace/presentation/settings/settings_dialog.dart';
|
||||
import 'package:app_flowy/workspace/presentation/settings/widgets/settings_user_view.dart';
|
||||
import 'package:flowy_infra/image.dart';
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/theme.dart';
|
||||
@ -41,6 +42,9 @@ class MenuUser extends StatelessWidget {
|
||||
|
||||
Widget _renderAvatar(BuildContext context) {
|
||||
String iconUrl = context.read<MenuUserBloc>().state.userProfile.iconUrl;
|
||||
if (iconUrl.isEmpty) {
|
||||
iconUrl = defaultUserAvatar;
|
||||
}
|
||||
|
||||
return SizedBox(
|
||||
width: 25,
|
||||
|
@ -8,6 +8,8 @@ import 'package:flowy_infra/image.dart';
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
const defaultUserAvatar = '1F600';
|
||||
|
||||
class SettingsUserView extends StatelessWidget {
|
||||
final UserProfilePB user;
|
||||
SettingsUserView(this.user, {Key? key}) : super(key: ValueKey(user.id));
|
||||
@ -40,6 +42,9 @@ class SettingsUserView extends StatelessWidget {
|
||||
Widget _renderCurrentIcon(BuildContext context) {
|
||||
String iconUrl =
|
||||
context.read<SettingsUserViewBloc>().state.userProfile.iconUrl;
|
||||
if (iconUrl.isEmpty) {
|
||||
iconUrl = defaultUserAvatar;
|
||||
}
|
||||
return _CurrentIcon(iconUrl);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user