treewide: Container -> SizedBox.shrink()

This helps performance without any user-facing changes,
since SizedBox is constant while Container isn't
This commit is contained in:
noob_tea 2023-03-22 20:28:31 +01:00
commit ab0b7cb6b9
21 changed files with 31 additions and 31 deletions

View file

@ -227,7 +227,7 @@ class ChatListViewBody extends StatelessWidget {
.contains(
controller.searchController.text.toLowerCase(),
)) {
return Container();
return const SizedBox.shrink();
}
return ChatListItem(
rooms[i],

View file

@ -326,7 +326,7 @@ class ChatListItem extends StatelessWidget {
fontSize: 13,
),
)
: Container(),
: const SizedBox.shrink(),
),
),
],

View file

@ -189,7 +189,7 @@ class ClientChooserButton extends StatelessWidget {
index,
context,
),
child: Container(),
child: const SizedBox.shrink(),
),
),
KeyBoardShortcuts(
@ -199,7 +199,7 @@ class ClientChooserButton extends StatelessWidget {
},
helpLabel: L10n.of(context)!.nextAccount,
onKeysPressed: () => _nextAccount(matrix, context),
child: Container(),
child: const SizedBox.shrink(),
),
KeyBoardShortcuts(
keysToPress: {
@ -209,7 +209,7 @@ class ClientChooserButton extends StatelessWidget {
},
helpLabel: L10n.of(context)!.previousAccount,
onKeysPressed: () => _previousAccount(matrix, context),
child: Container(),
child: const SizedBox.shrink(),
),
PopupMenuButton<Object>(
onSelected: (o) => _clientSelected(o, context),

View file

@ -121,7 +121,7 @@ class StoriesHeader extends StatelessWidget {
final displayname = creator.calcDisplayname();
final avatarUrl = creator.avatarUrl;
if (!displayname.toLowerCase().contains(filter.toLowerCase())) {
return Container();
return const SizedBox.shrink();
}
return _StoryButton(
profile: Profile(