mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: show icon in avatar
This commit is contained in:
parent
4eccdf3d28
commit
db19337609
@ -19,7 +19,8 @@ class MenuUser extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return BlocProvider<MenuUserBloc>(
|
return BlocProvider<MenuUserBloc>(
|
||||||
create: (context) => getIt<MenuUserBloc>(param1: user)..add(const MenuUserEvent.initial()),
|
create: (context) =>
|
||||||
|
getIt<MenuUserBloc>(param1: user)..add(const MenuUserEvent.initial()),
|
||||||
child: BlocBuilder<MenuUserBloc, MenuUserState>(
|
child: BlocBuilder<MenuUserBloc, MenuUserState>(
|
||||||
builder: (context, state) => Row(
|
builder: (context, state) => Row(
|
||||||
children: [
|
children: [
|
||||||
@ -39,20 +40,16 @@ class MenuUser extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _renderAvatar(BuildContext context) {
|
Widget _renderAvatar(BuildContext context) {
|
||||||
return const SizedBox(
|
String icon = context.read<MenuUserBloc>().state.userProfile.icon;
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
width: 25,
|
width: 25,
|
||||||
height: 25,
|
height: 25,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: Corners.s5Border,
|
borderRadius: Corners.s5Border,
|
||||||
child: CircleAvatar(
|
child: CircleAvatar(
|
||||||
backgroundColor: Color.fromRGBO(132, 39, 224, 1.0),
|
backgroundColor: Colors.transparent,
|
||||||
child: Text(
|
child: svgWidget('emoji/$icon'),
|
||||||
'M',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.w300,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user