fix: Stuff

This commit is contained in:
Christian Pauly 2021-09-19 12:44:00 +02:00
parent 7f6e37adf2
commit 4e8111a150

View File

@ -821,32 +821,36 @@ class _ChatAccountPicker extends StatelessWidget {
controller.matrix ??= Matrix.of(context); controller.matrix ??= Matrix.of(context);
final clients = controller.matrix.currentBundle; final clients = controller.matrix.currentBundle;
clients.removeWhere((c) => c.getRoomById(controller.roomId) == null); clients.removeWhere((c) => c.getRoomById(controller.roomId) == null);
return FutureBuilder<Profile>( return Padding(
future: controller.matrix.client.ownProfile, padding: const EdgeInsets.all(8.0),
builder: (context, snapshot) => PopupMenuButton<String>( child: FutureBuilder<Profile>(
onSelected: _popupMenuButtonSelected, future: controller.matrix.client.ownProfile,
itemBuilder: (BuildContext context) => clients builder: (context, snapshot) => PopupMenuButton<String>(
.map((client) => PopupMenuItem<String>( onSelected: _popupMenuButtonSelected,
value: client.userID, itemBuilder: (BuildContext context) => clients
child: FutureBuilder<Profile>( .map((client) => PopupMenuItem<String>(
future: client.ownProfile, value: client.userID,
builder: (context, snapshot) => ListTile( child: FutureBuilder<Profile>(
leading: Avatar( future: client.ownProfile,
snapshot.data?.avatarUrl, builder: (context, snapshot) => ListTile(
snapshot.data?.displayName ?? client.userID.localpart, leading: Avatar(
size: 20, snapshot.data?.avatarUrl,
snapshot.data?.displayName ?? client.userID.localpart,
size: 20,
),
title:
Text(snapshot.data?.displayName ?? client.userID),
contentPadding: EdgeInsets.all(0),
), ),
title: Text(snapshot.data?.displayName ?? client.userID),
contentPadding: EdgeInsets.all(0),
), ),
), ))
)) .toList(),
.toList(), child: Avatar(
child: Avatar( snapshot.data?.avatarUrl,
snapshot.data?.avatarUrl, snapshot.data?.displayName ??
snapshot.data?.displayName ?? controller.matrix.client.userID.localpart,
controller.matrix.client.userID.localpart, size: 20,
size: 20, ),
), ),
), ),
); );