🎨 Use Gap instead of empty SizedBox
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:solian/models/account.dart';
|
||||
@ -150,7 +151,7 @@ class AccountHeadingWidget extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
).paddingOnly(left: 116, top: 6),
|
||||
const SizedBox(height: 4),
|
||||
const Gap(4),
|
||||
if (badges?.isNotEmpty ?? false)
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/models/account.dart';
|
||||
import 'package:solian/providers/account_status.dart';
|
||||
@ -72,7 +73,7 @@ class _AccountProfilePopupState extends State<AccountProfilePopup> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.cancel, size: 24),
|
||||
const SizedBox(height: 12),
|
||||
const Gap(12),
|
||||
Text(
|
||||
_hasError.toString(),
|
||||
textAlign: TextAlign.center,
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
@ -214,7 +215,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
child: const LinearProgressIndicator().animate().scaleX(),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
const Gap(18),
|
||||
TextField(
|
||||
controller: _labelController,
|
||||
decoration: InputDecoration(
|
||||
@ -226,7 +227,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
TextField(
|
||||
controller: _clearAtController,
|
||||
readOnly: true,
|
||||
@ -238,7 +239,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
||||
),
|
||||
onTap: () => selectClearAt(),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Wrap(
|
||||
@ -281,7 +282,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Wrap(
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/screens/auth/signin.dart';
|
||||
|
||||
@ -20,7 +21,7 @@ class SigninRequiredOverlay extends StatelessWidget {
|
||||
Icons.login,
|
||||
size: 48,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
Text(
|
||||
'signinRequired'.tr,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
import 'package:solian/models/attachment.dart';
|
||||
@ -74,7 +75,7 @@ class _AttachmentAttrEditorDialogState
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
child: const LinearProgressIndicator().animate().scaleX(),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
const Gap(18),
|
||||
TextField(
|
||||
controller: _altController,
|
||||
decoration: InputDecoration(
|
||||
@ -86,7 +87,7 @@ class _AttachmentAttrEditorDialogState
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
CheckboxListTile(
|
||||
contentPadding: const EdgeInsets.only(left: 4, right: 18),
|
||||
shape: const RoundedRectangleBorder(
|
||||
|
@ -7,6 +7,7 @@ import 'package:dismissible_page/dismissible_page.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
@ -144,7 +145,7 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('attachmentAddLinkHint'.tr, textAlign: TextAlign.left),
|
||||
const SizedBox(height: 18),
|
||||
const Gap(18),
|
||||
TextField(
|
||||
controller: controller,
|
||||
decoration: InputDecoration(
|
||||
@ -353,7 +354,7 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const Gap(6),
|
||||
if (element.progress != null)
|
||||
Text(
|
||||
'${(element.progress! * 100).toStringAsFixed(2)}%',
|
||||
@ -614,7 +615,7 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
const Gap(10),
|
||||
Obx(() {
|
||||
if (_uploadController.isUploading.value) {
|
||||
return SizedBox(
|
||||
@ -635,9 +636,9 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
const Gap(20),
|
||||
Text('attachmentAutoUpload'.tr),
|
||||
const SizedBox(width: 8),
|
||||
const Gap(8),
|
||||
Switch(
|
||||
value: _isAutoUpload,
|
||||
onChanged: (bool? value) {
|
||||
|
@ -6,6 +6,7 @@ import 'package:dismissible_page/dismissible_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:gal/gal.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
import 'package:solian/models/attachment.dart';
|
||||
@ -198,7 +199,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
|
||||
radius: 19,
|
||||
),
|
||||
),
|
||||
const IgnorePointer(child: SizedBox(width: 8)),
|
||||
const IgnorePointer(child: Gap(8)),
|
||||
Expanded(
|
||||
child: IgnorePointer(
|
||||
child: Column(
|
||||
@ -240,7 +241,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
const IgnorePointer(child: SizedBox(height: 4)),
|
||||
const IgnorePointer(child: Gap(4)),
|
||||
IgnorePointer(
|
||||
child: Text(
|
||||
widget.item.alt,
|
||||
@ -252,7 +253,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
const IgnorePointer(child: SizedBox(height: 2)),
|
||||
const IgnorePointer(child: Gap(2)),
|
||||
IgnorePointer(
|
||||
child: Wrap(
|
||||
spacing: 6,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:media_kit_video/media_kit_video.dart';
|
||||
@ -65,7 +66,7 @@ class _AttachmentItemState extends State<AttachmentItem> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.file_present, size: 32),
|
||||
const SizedBox(height: 6),
|
||||
const Gap(6),
|
||||
Text(
|
||||
widget.item.mimetype,
|
||||
style: TextStyle(
|
||||
@ -74,13 +75,13 @@ class _AttachmentItemState extends State<AttachmentItem> {
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
const Gap(2),
|
||||
Text(
|
||||
widget.item.alt,
|
||||
style: const TextStyle(fontSize: 13),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const Gap(12),
|
||||
TextButton.icon(
|
||||
icon: const Icon(Icons.launch),
|
||||
label: Text('openInBrowser'.tr),
|
||||
@ -282,7 +283,7 @@ class _AttachmentItemVideoState extends State<_AttachmentItemVideo> {
|
||||
color: Colors.white,
|
||||
size: 32,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
Text(
|
||||
'attachmentUnload'.tr,
|
||||
style: const TextStyle(
|
||||
|
@ -5,6 +5,7 @@ import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:dismissible_page/dismissible_page.dart';
|
||||
import 'package:flutter/material.dart' hide CarouselController;
|
||||
import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/models/attachment.dart';
|
||||
import 'package:solian/widgets/attachments/attachment_item.dart';
|
||||
@ -359,7 +360,7 @@ class AttachmentListEntry extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
size: 32,
|
||||
),
|
||||
if (!isDense) const SizedBox(height: 8),
|
||||
if (!isDense) const Gap(8),
|
||||
if (!isDense)
|
||||
Text(
|
||||
'matureContent'.tr,
|
||||
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
import 'package:avatar_stack/avatar_stack.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/models/account.dart';
|
||||
import 'package:solian/models/call.dart';
|
||||
@ -60,7 +61,7 @@ class ChannelCallIndicator extends StatelessWidget {
|
||||
}));
|
||||
}
|
||||
}),
|
||||
const SizedBox(width: 6),
|
||||
const Gap(6),
|
||||
Obx(() {
|
||||
if (call.isInitialized.value) {
|
||||
return const SizedBox();
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:livekit_client/livekit_client.dart';
|
||||
|
||||
@ -35,7 +36,7 @@ class ParticipantInfoWidget extends StatelessWidget {
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
const Gap(5),
|
||||
isScreenShare
|
||||
? const Icon(
|
||||
Icons.monitor,
|
||||
@ -47,7 +48,7 @@ class ParticipantInfoWidget extends StatelessWidget {
|
||||
color: audioAvailable ? Colors.white : Colors.red,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 3),
|
||||
const Gap(3),
|
||||
if (connectionQuality != ConnectionQuality.unknown)
|
||||
Icon(
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/controllers/chat_events_controller.dart';
|
||||
import 'package:solian/models/event.dart';
|
||||
@ -214,7 +215,7 @@ class ChatEvent extends StatelessWidget {
|
||||
opacity: 0.75,
|
||||
child: FaIcon(FontAwesomeIcons.quoteLeft, size: 14),
|
||||
).paddingOnly(bottom: 2.75),
|
||||
const SizedBox(width: 4),
|
||||
const Gap(4),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@ -226,12 +227,12 @@ class ChatEvent extends StatelessWidget {
|
||||
content: item.sender.account.avatar,
|
||||
radius: 9,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
const Gap(5),
|
||||
Text(
|
||||
item.sender.account.nick,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const Gap(4),
|
||||
Text(format(item.createdAt, locale: 'en_short')),
|
||||
],
|
||||
),
|
||||
@ -275,7 +276,7 @@ class ChatEvent extends StatelessWidget {
|
||||
item.sender.account.nick,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const Gap(4),
|
||||
Text(format(item.createdAt, locale: 'en_short'))
|
||||
],
|
||||
).paddingSymmetric(horizontal: 12),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ChatEventMessageActionLog extends StatelessWidget {
|
||||
@ -25,7 +26,7 @@ class ChatEventMessageActionLog extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
icon,
|
||||
const SizedBox(width: 4),
|
||||
const Gap(4),
|
||||
Text(text),
|
||||
],
|
||||
).paddingOnly(
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/models/channel.dart';
|
||||
|
||||
@ -47,7 +48,7 @@ class _ChatTypingIndicatorState extends State<ChatTypingIndicator>
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.more_horiz),
|
||||
const SizedBox(width: 6),
|
||||
const Gap(6),
|
||||
Text('typingMessage'.trParams({
|
||||
'user': widget.users.map((x) => x.account.nick).join(', '),
|
||||
})),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:solian/controllers/post_editor_controller.dart';
|
||||
@ -86,7 +87,7 @@ class _PostEditorDateDialogState extends State<PostEditorDateDialog> {
|
||||
),
|
||||
onTap: () => _selectDate(0),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Gap(16),
|
||||
TextField(
|
||||
controller: _publishedUntilController,
|
||||
readOnly: true,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/controllers/post_editor_controller.dart';
|
||||
|
||||
@ -25,7 +26,7 @@ class PostEditorOverviewDialog extends StatelessWidget {
|
||||
),
|
||||
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Gap(16),
|
||||
TextField(
|
||||
autofocus: true,
|
||||
autocorrect: true,
|
||||
@ -37,7 +38,7 @@ class PostEditorOverviewDialog extends StatelessWidget {
|
||||
),
|
||||
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Gap(16),
|
||||
TextField(
|
||||
enabled: controller.mode.value == 1,
|
||||
maxLines: null,
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/controllers/post_editor_controller.dart';
|
||||
import 'package:solian/widgets/attachments/attachment_editor.dart';
|
||||
@ -68,7 +69,7 @@ class _PostEditorThumbnailDialogState extends State<PostEditorThumbnailDialog> {
|
||||
_promptUploadNewAttachment();
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
TextField(
|
||||
controller: _attachmentController,
|
||||
decoration: InputDecoration(
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:dropdown_button2/dropdown_button2.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/controllers/post_editor_controller.dart';
|
||||
import 'package:solian/widgets/account/account_select.dart';
|
||||
@ -56,7 +57,7 @@ class PostEditorVisibilityDialog extends StatelessWidget {
|
||||
Obx(() {
|
||||
if (controller.visibility.value == 2 ||
|
||||
controller.visibility.value == 3) {
|
||||
return const SizedBox(height: 8);
|
||||
return const Gap(8);
|
||||
}
|
||||
return const SizedBox();
|
||||
}),
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/services.dart';
|
||||
|
||||
@ -111,7 +112,7 @@ class _TagsFieldState extends State<TagsField> {
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4.0),
|
||||
const Gap(4),
|
||||
InkWell(
|
||||
child: const Icon(
|
||||
Icons.cancel,
|
||||
|
@ -2,6 +2,7 @@ import 'package:animations/animations.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get_utils/get_utils.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:solian/models/post.dart';
|
||||
@ -519,7 +520,7 @@ class _PostItemState extends State<PostItem> {
|
||||
bottom: 10,
|
||||
)
|
||||
else
|
||||
const SizedBox(height: 10),
|
||||
const Gap(10),
|
||||
],
|
||||
),
|
||||
openBuilder: (_, __) => TitleShell(
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/models/reaction.dart';
|
||||
|
||||
@ -33,9 +34,11 @@ class PostReactionPopup extends StatelessWidget {
|
||||
label: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(e.key,
|
||||
style: const TextStyle(fontFamily: 'monospace')),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
e.key,
|
||||
style: const TextStyle(fontFamily: 'monospace'),
|
||||
),
|
||||
const Gap(6),
|
||||
Text('x${reactionList[e.key]?.toString() ?? '0'}',
|
||||
style:
|
||||
const TextStyle(fontWeight: FontWeight.bold)),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/exts.dart';
|
||||
import 'package:solian/models/stickers.dart';
|
||||
@ -127,7 +128,7 @@ class _StickerUploadDialogState extends State<StickerUploadDialog> {
|
||||
_promptUploadNewAttachment();
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
TextField(
|
||||
controller: _attachmentController,
|
||||
decoration: InputDecoration(
|
||||
@ -138,7 +139,7 @@ class _StickerUploadDialogState extends State<StickerUploadDialog> {
|
||||
),
|
||||
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Gap(8),
|
||||
TextField(
|
||||
controller: _packController,
|
||||
decoration: InputDecoration(
|
||||
|
Reference in New Issue
Block a user