🎨 Use Gap instead of empty SizedBox

This commit is contained in:
LittleSheep 2024-09-07 17:45:44 +08:00
parent 9c451f485a
commit 85f97521e5
35 changed files with 115 additions and 78 deletions

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:provider/provider.dart';
@ -197,7 +198,7 @@ class _BootstrapperShellState extends State<BootstrapperShell> {
height: 24,
child: CircularProgressIndicator(strokeWidth: 3),
),
const SizedBox(height: 12),
const Gap(12),
CenteredContainer(
maxWidth: 280,
child: Column(

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher_string.dart';
@ -21,7 +22,7 @@ class AboutScreen extends StatelessWidget {
borderRadius: const BorderRadius.all(Radius.circular(16)),
child: Image.asset('assets/logo.png', width: 120, height: 120),
),
const SizedBox(height: 8),
const Gap(8),
Text(
'Solian',
style: Theme.of(context).textTheme.headlineMedium,
@ -30,7 +31,7 @@ class AboutScreen extends StatelessWidget {
'The Solar Network',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
const SizedBox(height: 8),
const Gap(8),
FutureBuilder(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
@ -45,7 +46,7 @@ class AboutScreen extends StatelessWidget {
},
),
Text('Copyright © ${DateTime.now().year} Solsynth LLC'),
const SizedBox(height: 16),
const Gap(16),
TextButton(
style: denseButtonStyle,
child: const Text('App Details'),
@ -59,7 +60,8 @@ class AboutScreen extends StatelessWidget {
'The Solar Network App is an intuitive and self-hostable social network and computing platform. Experience the freedom of a user-friendly design that empowers you to create and connect with communities on your own terms. Embrace the future of social networking with a platform that prioritizes your independence and privacy.',
applicationIcon: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(16)),
child: Image.asset('assets/logo.png', width: 60, height: 60),
child:
Image.asset('assets/logo.png', width: 60, height: 60),
),
);
},
@ -71,7 +73,7 @@ class AboutScreen extends StatelessWidget {
launchUrlString('https://solsynth.dev/products/solar-network');
},
),
const SizedBox(height: 16),
const Gap(16),
const Text(
'Open-sourced under AGPLv3',
style: TextStyle(

View File

@ -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/relations.dart';
@ -56,7 +57,7 @@ class _FriendScreenState extends State<FriendScreen>
mainAxisSize: MainAxisSize.min,
children: [
Text('accountFriendNewHint'.tr, textAlign: TextAlign.left),
const SizedBox(height: 18),
const Gap(18),
TextField(
controller: controller,
decoration: InputDecoration(

View File

@ -2,6 +2,7 @@ import 'dart:io';
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';
@ -185,7 +186,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
child: ListView(
children: [
if (_isBusy) const LinearProgressIndicator().animate().scaleX(),
const SizedBox(height: 24),
const Gap(24),
Stack(
children: [
AccountAvatar(content: _avatar, radius: 40),
@ -202,7 +203,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
],
).paddingSymmetric(horizontal: padding),
const SizedBox(height: 16),
const Gap(16),
Stack(
children: [
ClipRRect(
@ -247,7 +248,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
],
).paddingSymmetric(horizontal: padding),
const SizedBox(height: 24),
const Gap(24),
Row(
children: [
Flexible(
@ -262,7 +263,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
),
),
const SizedBox(width: 16),
const Gap(16),
Flexible(
flex: 1,
child: TextField(
@ -275,7 +276,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
],
).paddingSymmetric(horizontal: padding),
const SizedBox(height: 16),
const Gap(16),
Row(
children: [
Flexible(
@ -288,7 +289,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
),
),
const SizedBox(width: 16),
const Gap(16),
Flexible(
flex: 1,
child: TextField(
@ -301,7 +302,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
],
).paddingSymmetric(horizontal: padding),
const SizedBox(height: 16),
const Gap(16),
TextField(
controller: _descriptionController,
keyboardType: TextInputType.multiline,
@ -312,7 +313,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
labelText: 'description'.tr,
),
).paddingSymmetric(horizontal: padding),
const SizedBox(height: 16),
const Gap(16),
TextField(
controller: _birthdayController,
readOnly: true,
@ -322,7 +323,7 @@ class _PersonalizeScreenState extends State<PersonalizeScreen> {
),
onTap: () => _selectBirthday(),
).paddingSymmetric(horizontal: padding),
const SizedBox(height: 16),
const Gap(16),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:solian/controllers/post_list_controller.dart';
@ -156,12 +157,11 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
automaticallyImplyLeading: false,
flexibleSpace: Row(
children: [
AppBarLeadingButton.adaptive(context) ??
const SizedBox(width: 8),
const SizedBox(width: 8),
AppBarLeadingButton.adaptive(context) ?? const Gap(8),
const Gap(8),
if (_userinfo != null)
AccountAvatar(content: _userinfo!.avatar, radius: 16),
const SizedBox(width: 12),
const Gap(12),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -243,7 +243,7 @@ class _AccountProfilePageState extends State<AccountProfilePage> {
),
],
),
const SizedBox(height: 16),
const Gap(16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [

View File

@ -1,5 +1,6 @@
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:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:solian/models/pagination.dart';
@ -163,7 +164,7 @@ class _StickerScreenState extends State<StickerScreen> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(item.name),
const SizedBox(width: 6),
const Gap(6),
Badge(
label: Text('#${item.id}'),
)

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:protocol_handler/protocol_handler.dart';
import 'package:solian/exts.dart';
@ -160,7 +161,7 @@ class _SignInPopupState extends State<SignInPopup> with ProtocolListener {
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
),
const SizedBox(height: 12),
const Gap(12),
TextField(
obscureText: true,
autocorrect: false,
@ -176,7 +177,7 @@ class _SignInPopupState extends State<SignInPopup> with ProtocolListener {
FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted: (_) => performAction(),
),
const SizedBox(height: 12),
const Gap(12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [

View File

@ -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/services.dart';
@ -94,7 +95,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
),
const SizedBox(height: 12),
const Gap(12),
TextField(
autocorrect: false,
enableSuggestions: false,
@ -108,7 +109,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
),
const SizedBox(height: 12),
const Gap(12),
TextField(
autocorrect: false,
enableSuggestions: false,
@ -122,7 +123,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(),
),
const SizedBox(height: 12),
const Gap(12),
TextField(
obscureText: true,
autocorrect: false,
@ -138,7 +139,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted: (_) => performAction(context),
),
const SizedBox(height: 16),
const Gap(16),
Align(
alignment: Alignment.centerRight,
child: TextButton(

View File

@ -3,6 +3,7 @@ import 'dart:math' as math;
import 'package:async/async.dart';
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:solian/providers/call.dart';
import 'package:solian/theme.dart';
@ -257,7 +258,7 @@ class _CallScreenState extends State<CallScreen> with TickerProviderStateMixin {
fontWeight: FontWeight.bold,
),
),
const SizedBox(width: 6),
const Gap(6),
Text(call.lastDuration.value)
],
);
@ -276,7 +277,7 @@ class _CallScreenState extends State<CallScreen> with TickerProviderStateMixin {
'callStatusReconnecting'.tr,
}[call.room.connectionState]!,
),
const SizedBox(width: 6),
const Gap(6),
if (connectionQuality !=
livekit.ConnectionQuality.unknown)
Icon(

View File

@ -1,6 +1,7 @@
import 'package:dropdown_button2/dropdown_button2.dart';
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/exts.dart';
import 'package:solian/models/channel.dart';
@ -148,7 +149,7 @@ class _ChannelDetailScreenState extends State<ChannelDetailScreen> {
size: 18,
),
),
const SizedBox(width: 16),
const Gap(16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:solian/controllers/post_list_controller.dart';
import 'package:solian/providers/auth.dart';
@ -224,7 +225,7 @@ class PostCreatePopup extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
x.icon,
const SizedBox(height: 8),
const Gap(8),
Expanded(
child: Text(
x.label,

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:markdown_toolbar/markdown_toolbar.dart';
@ -183,7 +184,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(width: 6),
const Gap(6),
if (_editorController.aliasController.text.isNotEmpty)
Badge(
label: Text('#${_editorController.aliasController.text}'),
@ -296,7 +297,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
?.unfocus(),
),
),
const SizedBox(height: 120)
const Gap(120)
],
),
),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart';
import 'package:solian/models/realm.dart';
import 'package:solian/providers/auth.dart';
@ -95,7 +96,7 @@ class _RealmDetailScreenState extends State<RealmDetailScreen> {
backgroundColor: Colors.teal,
child: Icon(Icons.group, color: Colors.white),
),
const SizedBox(width: 16),
const Gap(16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -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,

View File

@ -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,

View File

@ -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(

View File

@ -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,

View File

@ -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(

View File

@ -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) {

View File

@ -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,

View File

@ -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(

View File

@ -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,

View File

@ -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();

View File

@ -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(
{

View File

@ -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),

View File

@ -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(

View File

@ -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(', '),
})),

View File

@ -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,

View File

@ -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,

View File

@ -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(

View File

@ -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();
}),

View File

@ -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,

View File

@ -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(

View File

@ -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)),

View File

@ -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(