diff --git a/lib/main.dart b/lib/main.dart index f27a8f6..5a5e079 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -109,7 +109,7 @@ class SolianApp extends StatelessWidget { return SystemShell( child: ScaffoldMessenger( child: BootstrapperShell( - child: child ?? const SizedBox(), + child: child ?? const SizedBox.shrink(), ), ), ); diff --git a/lib/screens/about.dart b/lib/screens/about.dart index 380810f..0ac995a 100644 --- a/lib/screens/about.dart +++ b/lib/screens/about.dart @@ -36,7 +36,7 @@ class AboutScreen extends StatelessWidget { future: PackageInfo.fromPlatform(), builder: (context, snapshot) { if (!snapshot.hasData) { - return const SizedBox(); + return const SizedBox.shrink(); } return Text( diff --git a/lib/screens/channel/call/call.dart b/lib/screens/channel/call/call.dart index dae2369..9074ca6 100644 --- a/lib/screens/channel/call/call.dart +++ b/lib/screens/channel/call/call.dart @@ -84,7 +84,7 @@ class _CallScreenState extends State with TickerProviderStateMixin { participant: call.focusTrack.value!, onTap: () {}, ) - : const SizedBox(), + : const SizedBox.shrink(), ), Positioned( left: 0, diff --git a/lib/screens/channel/channel_chat.dart b/lib/screens/channel/channel_chat.dart index f3532be..fdbef5f 100644 --- a/lib/screens/channel/channel_chat.dart +++ b/lib/screens/channel/channel_chat.dart @@ -222,7 +222,7 @@ class _ChannelChatScreenState extends State actions: [ const BackgroundStateWidget(), Builder(builder: (context) { - if (_isBusy || _channel == null) return const SizedBox(); + if (_isBusy || _channel == null) return const SizedBox.shrink(); return ChatCallButton( realm: _channel!.realm, @@ -299,7 +299,7 @@ class _ChannelChatScreenState extends State if (_chatController.isLoading.isTrue) { return const LinearProgressIndicator().animate().slideY(); } else { - return const SizedBox(); + return const SizedBox.shrink(); } }), ClipRect( @@ -350,7 +350,7 @@ class _ChannelChatScreenState extends State ]), ); } - return const SizedBox(); + return const SizedBox.shrink(); }), ], ); diff --git a/lib/screens/chat.dart b/lib/screens/chat.dart index 5804d2d..bcdb481 100644 --- a/lib/screens/chat.dart +++ b/lib/screens/chat.dart @@ -112,7 +112,7 @@ class _ChatScreenState extends State { children: [ Obx(() { if (_channels.isLoading.isFalse) { - return const SizedBox(); + return const SizedBox.shrink(); } else { return const LinearProgressIndicator(); } diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index 01417d4..2532705 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -190,7 +190,7 @@ class _DashboardScreenState extends State { icon: const Icon(Icons.local_fire_department), onPressed: _signingDaily ? null : _signDaily, ) - : const SizedBox(), + : const SizedBox.shrink(), ), ), ).paddingSymmetric(horizontal: 8), diff --git a/lib/screens/feed.dart b/lib/screens/feed.dart index 91b4bac..cb09f16 100644 --- a/lib/screens/feed.dart +++ b/lib/screens/feed.dart @@ -155,7 +155,7 @@ class PostCreatePopup extends StatelessWidget { final AuthProvider auth = Get.find(); if (auth.isAuthorized.isFalse) { - return const SizedBox(); + return const SizedBox.shrink(); } final List actionList = [ diff --git a/lib/widgets/account/account_badge.dart b/lib/widgets/account/account_badge.dart index 78a21d0..c968283 100644 --- a/lib/widgets/account/account_badge.dart +++ b/lib/widgets/account/account_badge.dart @@ -45,7 +45,7 @@ class _AccountBadgeWidgetState extends State { Widget build(BuildContext context) { final spec = badges[widget.item.type]; - if (spec == null) return const SizedBox(); + if (spec == null) return const SizedBox.shrink(); return Tooltip( richMessage: TextSpan( diff --git a/lib/widgets/account/account_heading.dart b/lib/widgets/account/account_heading.dart index d156dfe..c9a4b1f 100644 --- a/lib/widgets/account/account_heading.dart +++ b/lib/widgets/account/account_heading.dart @@ -71,7 +71,7 @@ class AccountHeadingWidget extends StatelessWidget { content: banner, fit: BoxFit.cover, ) - : const SizedBox(), + : const SizedBox.shrink(), ), ), ).paddingSymmetric(horizontal: 16), diff --git a/lib/widgets/app_bar_leading.dart b/lib/widgets/app_bar_leading.dart index 8abc1e1..3c88d45 100644 --- a/lib/widgets/app_bar_leading.dart +++ b/lib/widgets/app_bar_leading.dart @@ -22,7 +22,7 @@ class AppBarLeadingButton extends StatelessWidget { onPressed: () => rootScaffoldKey.currentState!.openDrawer(), ); } else { - return const SizedBox(); + return const SizedBox.shrink(); } } } diff --git a/lib/widgets/attachments/attachment_editor.dart b/lib/widgets/attachments/attachment_editor.dart index 9e77bc9..4929d8a 100644 --- a/lib/widgets/attachments/attachment_editor.dart +++ b/lib/widgets/attachments/attachment_editor.dart @@ -347,7 +347,8 @@ class _AttachmentEditorPopupState extends State { FutureBuilder( future: element.file.length(), builder: (context, snapshot) { - if (!snapshot.hasData) return const SizedBox(); + if (!snapshot.hasData) + return const SizedBox.shrink(); return Text( _formatBytes(snapshot.data!), style: Theme.of(context).textTheme.bodySmall, @@ -628,7 +629,7 @@ class _AttachmentEditorPopupState extends State { ), ); } - return const SizedBox(); + return const SizedBox.shrink(); }), ], ), @@ -667,7 +668,7 @@ class _AttachmentEditorPopupState extends State { ), Obx(() { if (_uploadController.isUploading.value) { - return const SizedBox(); + return const SizedBox.shrink(); } return TextButton( child: Text('attachmentUploadQueueStart'.tr), @@ -681,7 +682,7 @@ class _AttachmentEditorPopupState extends State { ), ); } - return const SliverToBoxAdapter(child: SizedBox()); + return const SliverToBoxAdapter(child: SizedBox.shrink()); }), Obx(() { if (_uploadController.queueOfUpload.isNotEmpty) { @@ -697,7 +698,7 @@ class _AttachmentEditorPopupState extends State { ), ); } - return const SliverToBoxAdapter(child: SizedBox()); + return const SliverToBoxAdapter(child: SizedBox.shrink()); }), if (_attachments.isNotEmpty) SliverPadding( diff --git a/lib/widgets/attachments/attachment_list.dart b/lib/widgets/attachments/attachment_list.dart index 38be0af..5e5739c 100644 --- a/lib/widgets/attachments/attachment_list.dart +++ b/lib/widgets/attachments/attachment_list.dart @@ -139,7 +139,7 @@ class _AttachmentListState extends State { @override Widget build(BuildContext context) { if (widget.attachmentsId.isEmpty) { - return const SizedBox(); + return const SizedBox.shrink(); } if (_isLoading) { @@ -172,7 +172,7 @@ class _AttachmentListState extends State { children: widget.attachmentsId.map((x) { final element = _attachmentsMeta[idx]; idx++; - if (element == null) return const SizedBox(); + if (element == null) return const SizedBox.shrink(); double ratio = element.metadata?['ratio']?.toDouble() ?? 16 / 9; return Container( decoration: BoxDecoration( diff --git a/lib/widgets/channel/channel_call_indicator.dart b/lib/widgets/channel/channel_call_indicator.dart index 2483bcd..c7e2a2b 100644 --- a/lib/widgets/channel/channel_call_indicator.dart +++ b/lib/widgets/channel/channel_call_indicator.dart @@ -64,7 +64,7 @@ class ChannelCallIndicator extends StatelessWidget { const Gap(6), Obx(() { if (call.isInitialized.value) { - return const SizedBox(); + return const SizedBox.shrink(); } if (ongoingCall.participants.isNotEmpty) { return Container( @@ -84,7 +84,7 @@ class ChannelCallIndicator extends StatelessWidget { ), ); } - return const SizedBox(); + return const SizedBox.shrink(); }) ], ), @@ -113,7 +113,7 @@ class ChannelCallIndicator extends StatelessWidget { child: Text('callJoin'.tr), ); } - return const SizedBox(); + return const SizedBox.shrink(); }) ], ); diff --git a/lib/widgets/chat/call/chat_call_indicator.dart b/lib/widgets/chat/call/chat_call_indicator.dart index da52ece..2280f7d 100644 --- a/lib/widgets/chat/call/chat_call_indicator.dart +++ b/lib/widgets/chat/call/chat_call_indicator.dart @@ -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( diff --git a/lib/widgets/chat/chat_event.dart b/lib/widgets/chat/chat_event.dart index ce77883..32047d0 100644 --- a/lib/widgets/chat/chat_event.dart +++ b/lib/widgets/chat/chat_event.dart @@ -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.from(item.body['attachments']?.whereType()) : List.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( diff --git a/lib/widgets/chat/chat_event_list.dart b/lib/widgets/chat/chat_event_list.dart index a74057a..9fe8d99 100644 --- a/lib/widgets/chat/chat_event_list.dart +++ b/lib/widgets/chat/chat_event_list.dart @@ -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( diff --git a/lib/widgets/link_expansion.dart b/lib/widgets/link_expansion.dart index aeddb40..ca0b750 100644 --- a/lib/widgets/link_expansion.dart +++ b/lib/widgets/link_expansion.dart @@ -57,7 +57,7 @@ class LinkExpansion extends StatelessWidget { ); final matches = linkRegex.allMatches(content); if (matches.isEmpty) { - return const SizedBox(); + return const SizedBox.shrink(); } final LinkExpandProvider expandController = Get.find(); @@ -72,7 +72,7 @@ class LinkExpansion extends StatelessWidget { future: expandController.expandLink(x.group(0)!), builder: (context, snapshot) { if (!snapshot.hasData) { - return const SizedBox(); + return const SizedBox.shrink(); } final isRichDescription = [ diff --git a/lib/widgets/posts/editor/post_editor_visibility.dart b/lib/widgets/posts/editor/post_editor_visibility.dart index 1b6feaa..0d272f3 100644 --- a/lib/widgets/posts/editor/post_editor_visibility.dart +++ b/lib/widgets/posts/editor/post_editor_visibility.dart @@ -59,7 +59,7 @@ class PostEditorVisibilityDialog extends StatelessWidget { controller.visibility.value == 3) { return const Gap(8); } - return const SizedBox(); + return const SizedBox.shrink(); }), Obx(() { if (controller.visibility.value == 2) { @@ -86,7 +86,7 @@ class PostEditorVisibilityDialog extends StatelessWidget { }, ); } - return const SizedBox(); + return const SizedBox.shrink(); }), Obx(() { if (controller.visibility.value == 3) { @@ -113,7 +113,7 @@ class PostEditorVisibilityDialog extends StatelessWidget { }, ); } - return const SizedBox(); + return const SizedBox.shrink(); }), ], ), diff --git a/lib/widgets/posts/post_item.dart b/lib/widgets/posts/post_item.dart index 0934b5b..fddb904 100644 --- a/lib/widgets/posts/post_item.dart +++ b/lib/widgets/posts/post_item.dart @@ -79,7 +79,7 @@ class _PostItemState extends State { } Widget _buildThumbnail() { - if (widget.item.body['thumbnail'] == null) return const SizedBox(); + if (widget.item.body['thumbnail'] == null) return const SizedBox.shrink(); final border = BorderSide( color: Theme.of(context).dividerColor, width: 0.3, @@ -148,7 +148,7 @@ class _PostItemState extends State { vertical: 8, ); } - return const SizedBox(); + return const SizedBox.shrink(); } Widget _buildFooter() { @@ -187,7 +187,7 @@ class _PostItemState extends State { } if (widgets.isEmpty) { - return const SizedBox(); + return const SizedBox.shrink(); } else { return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/posts/post_warped_list.dart b/lib/widgets/posts/post_warped_list.dart index 5293dc9..1e4c317 100644 --- a/lib/widgets/posts/post_warped_list.dart +++ b/lib/widgets/posts/post_warped_list.dart @@ -29,7 +29,7 @@ class PostWarpedListWidget extends StatelessWidget { builderDelegate: PagedChildBuilderDelegate( itemBuilder: (context, item, index) { if (item.pinnedAt != null && !isPinned) { - return const SizedBox(); + return const SizedBox.shrink(); } return PostListEntryWidget( renderOrder: index,