refactor: Avatar widget
This commit is contained in:
parent
29c0f12609
commit
53967eb1f0
20 changed files with 69 additions and 47 deletions
|
|
@ -171,7 +171,11 @@ class ChatListItem extends StatelessWidget {
|
|||
child: const Icon(Icons.check, color: Colors.white),
|
||||
),
|
||||
)
|
||||
: Avatar(room.avatar, room.displayname, onTap: onLongPress),
|
||||
: Avatar(
|
||||
mxContent: room.avatar,
|
||||
name: room.displayname,
|
||||
onTap: onLongPress,
|
||||
),
|
||||
title: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
|
|
|
|||
|
|
@ -48,8 +48,9 @@ class ClientChooserButton extends StatelessWidget {
|
|||
builder: (context, snapshot) => Row(
|
||||
children: [
|
||||
Avatar(
|
||||
snapshot.data?.avatarUrl,
|
||||
snapshot.data?.displayName ?? client.userID.localpart,
|
||||
mxContent: snapshot.data?.avatarUrl,
|
||||
name: snapshot.data?.displayName ??
|
||||
client.userID.localpart,
|
||||
size: 28,
|
||||
fontSize: 12,
|
||||
),
|
||||
|
|
@ -84,8 +85,8 @@ class ClientChooserButton extends StatelessWidget {
|
|||
future: matrix.client.ownProfile,
|
||||
builder: (context, snapshot) => PopupMenuButton<Object>(
|
||||
child: Avatar(
|
||||
snapshot.data?.avatarUrl,
|
||||
snapshot.data?.displayName ?? matrix.client.userID.localpart,
|
||||
mxContent: snapshot.data?.avatarUrl,
|
||||
name: snapshot.data?.displayName ?? matrix.client.userID.localpart,
|
||||
size: 28,
|
||||
fontSize: 12,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@ class SpacesBottomBar extends StatelessWidget {
|
|||
onLongPress: () =>
|
||||
controller.editSpace(context, space.id),
|
||||
child: Avatar(
|
||||
space.avatar,
|
||||
space.displayname,
|
||||
mxContent: space.avatar,
|
||||
name: space.displayname,
|
||||
size: 24,
|
||||
fontSize: 12,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue