🎨 Use SizedBox.shrink instead of empty SizedBox for placeholder

This commit is contained in:
2024-09-07 17:48:07 +08:00
parent 85f97521e5
commit 4e8f2ddef3
20 changed files with 37 additions and 36 deletions

View File

@ -11,7 +11,7 @@ class ChatCallCurrentIndicator extends StatelessWidget {
return Obx(() {
if (call.current.value == null || call.channel.value == null) {
return const SizedBox();
return const SizedBox.shrink();
}
return ListTile(

View File

@ -40,7 +40,7 @@ class ChatEvent extends StatelessWidget {
}
Widget _buildLinkExpansion() {
if (item.body['text'] == null) return const SizedBox();
if (item.body['text'] == null) return const SizedBox.shrink();
return LinkExpansion(content: item.body['text']);
}
@ -49,7 +49,7 @@ class ChatEvent extends StatelessWidget {
? List<String>.from(item.body['attachments']?.whereType<String>())
: List<String>.empty();
if (attachments.isEmpty) return const SizedBox();
if (attachments.isEmpty) return const SizedBox.shrink();
if (isMinimal) {
final unFocusColor =
@ -94,7 +94,7 @@ class ChatEvent extends StatelessWidget {
),
builder: (context, snapshot) {
if (!snapshot.hasData || snapshot.data == null) {
return const SizedBox();
return const SizedBox.shrink();
}
return Container(

View File

@ -96,7 +96,7 @@ class ChatEventList extends StatelessWidget {
chatController.totalEvents - chatController.currentEvents.length;
if (amount.value <= 0 || chatController.isLoading.isTrue) {
return const SliverToBoxAdapter(child: SizedBox());
return const SliverToBoxAdapter(child: SizedBox.shrink());
}
return SliverToBoxAdapter(