diff --git a/lib/bootstrapper.dart b/lib/bootstrapper.dart index a79d1fa..3d1d366 100644 --- a/lib/bootstrapper.dart +++ b/lib/bootstrapper.dart @@ -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 { height: 24, child: CircularProgressIndicator(strokeWidth: 3), ), - const SizedBox(height: 12), + const Gap(12), CenteredContainer( maxWidth: 280, child: Column( diff --git a/lib/screens/about.dart b/lib/screens/about.dart index 295c59b..380810f 100644 --- a/lib/screens/about.dart +++ b/lib/screens/about.dart @@ -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( diff --git a/lib/screens/account/friend.dart b/lib/screens/account/friend.dart index 802fb75..ad9bf3e 100644 --- a/lib/screens/account/friend.dart +++ b/lib/screens/account/friend.dart @@ -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 mainAxisSize: MainAxisSize.min, children: [ Text('accountFriendNewHint'.tr, textAlign: TextAlign.left), - const SizedBox(height: 18), + const Gap(18), TextField( controller: controller, decoration: InputDecoration( diff --git a/lib/screens/account/personalize.dart b/lib/screens/account/personalize.dart index 5dde820..adbe96e 100644 --- a/lib/screens/account/personalize.dart +++ b/lib/screens/account/personalize.dart @@ -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 { 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 { ), ], ).paddingSymmetric(horizontal: padding), - const SizedBox(height: 16), + const Gap(16), Stack( children: [ ClipRRect( @@ -247,7 +248,7 @@ class _PersonalizeScreenState extends State { ), ], ).paddingSymmetric(horizontal: padding), - const SizedBox(height: 24), + const Gap(24), Row( children: [ Flexible( @@ -262,7 +263,7 @@ class _PersonalizeScreenState extends State { ), ), ), - const SizedBox(width: 16), + const Gap(16), Flexible( flex: 1, child: TextField( @@ -275,7 +276,7 @@ class _PersonalizeScreenState extends State { ), ], ).paddingSymmetric(horizontal: padding), - const SizedBox(height: 16), + const Gap(16), Row( children: [ Flexible( @@ -288,7 +289,7 @@ class _PersonalizeScreenState extends State { ), ), ), - const SizedBox(width: 16), + const Gap(16), Flexible( flex: 1, child: TextField( @@ -301,7 +302,7 @@ class _PersonalizeScreenState extends State { ), ], ).paddingSymmetric(horizontal: padding), - const SizedBox(height: 16), + const Gap(16), TextField( controller: _descriptionController, keyboardType: TextInputType.multiline, @@ -312,7 +313,7 @@ class _PersonalizeScreenState extends State { 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 { ), onTap: () => _selectBirthday(), ).paddingSymmetric(horizontal: padding), - const SizedBox(height: 16), + const Gap(16), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ diff --git a/lib/screens/account/profile_page.dart b/lib/screens/account/profile_page.dart index b972d09..60d426f 100644 --- a/lib/screens/account/profile_page.dart +++ b/lib/screens/account/profile_page.dart @@ -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 { 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 { ), ], ), - const SizedBox(height: 16), + const Gap(16), Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ diff --git a/lib/screens/account/stickers.dart b/lib/screens/account/stickers.dart index 45213c2..0dca59d 100644 --- a/lib/screens/account/stickers.dart +++ b/lib/screens/account/stickers.dart @@ -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 { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text(item.name), - const SizedBox(width: 6), + const Gap(6), Badge( label: Text('#${item.id}'), ) diff --git a/lib/screens/auth/signin.dart b/lib/screens/auth/signin.dart index 1b640f6..7a1d6b9 100644 --- a/lib/screens/auth/signin.dart +++ b/lib/screens/auth/signin.dart @@ -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 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 with ProtocolListener { FocusManager.instance.primaryFocus?.unfocus(), onSubmitted: (_) => performAction(), ), - const SizedBox(height: 12), + const Gap(12), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/screens/auth/signup.dart b/lib/screens/auth/signup.dart index aa9be90..491f1e3 100644 --- a/lib/screens/auth/signup.dart +++ b/lib/screens/auth/signup.dart @@ -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 { 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 { 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 { 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 { FocusManager.instance.primaryFocus?.unfocus(), onSubmitted: (_) => performAction(context), ), - const SizedBox(height: 16), + const Gap(16), Align( alignment: Alignment.centerRight, child: TextButton( diff --git a/lib/screens/channel/call/call.dart b/lib/screens/channel/call/call.dart index 2586aca..dae2369 100644 --- a/lib/screens/channel/call/call.dart +++ b/lib/screens/channel/call/call.dart @@ -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 with TickerProviderStateMixin { fontWeight: FontWeight.bold, ), ), - const SizedBox(width: 6), + const Gap(6), Text(call.lastDuration.value) ], ); @@ -276,7 +277,7 @@ class _CallScreenState extends State with TickerProviderStateMixin { 'callStatusReconnecting'.tr, }[call.room.connectionState]!, ), - const SizedBox(width: 6), + const Gap(6), if (connectionQuality != livekit.ConnectionQuality.unknown) Icon( diff --git a/lib/screens/channel/channel_detail.dart b/lib/screens/channel/channel_detail.dart index 79fd6ec..e0d8112 100644 --- a/lib/screens/channel/channel_detail.dart +++ b/lib/screens/channel/channel_detail.dart @@ -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 { size: 18, ), ), - const SizedBox(width: 16), + const Gap(16), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/feed.dart b/lib/screens/feed.dart index 8c4ebf9..91b4bac 100644 --- a/lib/screens/feed.dart +++ b/lib/screens/feed.dart @@ -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, diff --git a/lib/screens/posts/post_editor.dart b/lib/screens/posts/post_editor.dart index aab71b2..68a5e70 100644 --- a/lib/screens/posts/post_editor.dart +++ b/lib/screens/posts/post_editor.dart @@ -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 { 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 { ?.unfocus(), ), ), - const SizedBox(height: 120) + const Gap(120) ], ), ), diff --git a/lib/screens/realms/realm_detail.dart b/lib/screens/realms/realm_detail.dart index d083c83..ee5b899 100644 --- a/lib/screens/realms/realm_detail.dart +++ b/lib/screens/realms/realm_detail.dart @@ -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 { backgroundColor: Colors.teal, child: Icon(Icons.group, color: Colors.white), ), - const SizedBox(width: 16), + const Gap(16), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/account/account_heading.dart b/lib/widgets/account/account_heading.dart index bcec3ca..d156dfe 100644 --- a/lib/widgets/account/account_heading.dart +++ b/lib/widgets/account/account_heading.dart @@ -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, diff --git a/lib/widgets/account/account_profile_popup.dart b/lib/widgets/account/account_profile_popup.dart index 233b3c1..65ce616 100644 --- a/lib/widgets/account/account_profile_popup.dart +++ b/lib/widgets/account/account_profile_popup.dart @@ -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 { mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon(Icons.cancel, size: 24), - const SizedBox(height: 12), + const Gap(12), Text( _hasError.toString(), textAlign: TextAlign.center, diff --git a/lib/widgets/account/account_status_action.dart b/lib/widgets/account/account_status_action.dart index a5e4ce6..ef8b59c 100644 --- a/lib/widgets/account/account_status_action.dart +++ b/lib/widgets/account/account_status_action.dart @@ -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 { 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 { 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 { ), onTap: () => selectClearAt(), ), - const SizedBox(height: 8), + const Gap(8), SingleChildScrollView( scrollDirection: Axis.horizontal, child: Wrap( @@ -281,7 +282,7 @@ class _AccountStatusEditorDialogState extends State { ], ), ), - const SizedBox(height: 8), + const Gap(8), SingleChildScrollView( scrollDirection: Axis.horizontal, child: Wrap( diff --git a/lib/widgets/account/signin_required_overlay.dart b/lib/widgets/account/signin_required_overlay.dart index 6ccb858..eb77864 100644 --- a/lib/widgets/account/signin_required_overlay.dart +++ b/lib/widgets/account/signin_required_overlay.dart @@ -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, diff --git a/lib/widgets/attachments/attachment_attr_editor.dart b/lib/widgets/attachments/attachment_attr_editor.dart index 8a727c8..d799630 100644 --- a/lib/widgets/attachments/attachment_attr_editor.dart +++ b/lib/widgets/attachments/attachment_attr_editor.dart @@ -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( diff --git a/lib/widgets/attachments/attachment_editor.dart b/lib/widgets/attachments/attachment_editor.dart index 12222ed..9e77bc9 100644 --- a/lib/widgets/attachments/attachment_editor.dart +++ b/lib/widgets/attachments/attachment_editor.dart @@ -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 { 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 { ); }, ), - 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 { 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 { ], ), ), - const SizedBox(width: 20), + const Gap(20), Text('attachmentAutoUpload'.tr), - const SizedBox(width: 8), + const Gap(8), Switch( value: _isAutoUpload, onChanged: (bool? value) { diff --git a/lib/widgets/attachments/attachment_fullscreen.dart b/lib/widgets/attachments/attachment_fullscreen.dart index 0f63b67..56dfe52 100644 --- a/lib/widgets/attachments/attachment_fullscreen.dart +++ b/lib/widgets/attachments/attachment_fullscreen.dart @@ -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 { 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 { ), ], ), - 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 { ), ), ), - const IgnorePointer(child: SizedBox(height: 2)), + const IgnorePointer(child: Gap(2)), IgnorePointer( child: Wrap( spacing: 6, diff --git a/lib/widgets/attachments/attachment_item.dart b/lib/widgets/attachments/attachment_item.dart index aa67cf5..74d4e7b 100644 --- a/lib/widgets/attachments/attachment_item.dart +++ b/lib/widgets/attachments/attachment_item.dart @@ -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 { 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 { ), 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( diff --git a/lib/widgets/attachments/attachment_list.dart b/lib/widgets/attachments/attachment_list.dart index 1311903..38be0af 100644 --- a/lib/widgets/attachments/attachment_list.dart +++ b/lib/widgets/attachments/attachment_list.dart @@ -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, diff --git a/lib/widgets/channel/channel_call_indicator.dart b/lib/widgets/channel/channel_call_indicator.dart index 9cb050a..2483bcd 100644 --- a/lib/widgets/channel/channel_call_indicator.dart +++ b/lib/widgets/channel/channel_call_indicator.dart @@ -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(); diff --git a/lib/widgets/chat/call/call_participant_info.dart b/lib/widgets/chat/call/call_participant_info.dart index c62e5d6..cad484a 100644 --- a/lib/widgets/chat/call/call_participant_info.dart +++ b/lib/widgets/chat/call/call_participant_info.dart @@ -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( { diff --git a/lib/widgets/chat/chat_event.dart b/lib/widgets/chat/chat_event.dart index e7eac3d..ce77883 100644 --- a/lib/widgets/chat/chat_event.dart +++ b/lib/widgets/chat/chat_event.dart @@ -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), diff --git a/lib/widgets/chat/chat_event_action_log.dart b/lib/widgets/chat/chat_event_action_log.dart index f3e6ec4..a689629 100644 --- a/lib/widgets/chat/chat_event_action_log.dart +++ b/lib/widgets/chat/chat_event_action_log.dart @@ -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( diff --git a/lib/widgets/chat/chat_typing_indicator.dart b/lib/widgets/chat/chat_typing_indicator.dart index 4bc4445..1f4ecc6 100644 --- a/lib/widgets/chat/chat_typing_indicator.dart +++ b/lib/widgets/chat/chat_typing_indicator.dart @@ -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 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(', '), })), diff --git a/lib/widgets/posts/editor/post_editor_date.dart b/lib/widgets/posts/editor/post_editor_date.dart index edcdec6..b806fba 100644 --- a/lib/widgets/posts/editor/post_editor_date.dart +++ b/lib/widgets/posts/editor/post_editor_date.dart @@ -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 { ), onTap: () => _selectDate(0), ), - const SizedBox(height: 16), + const Gap(16), TextField( controller: _publishedUntilController, readOnly: true, diff --git a/lib/widgets/posts/editor/post_editor_overview.dart b/lib/widgets/posts/editor/post_editor_overview.dart index 9734c57..243c977 100644 --- a/lib/widgets/posts/editor/post_editor_overview.dart +++ b/lib/widgets/posts/editor/post_editor_overview.dart @@ -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, diff --git a/lib/widgets/posts/editor/post_editor_thumbnail.dart b/lib/widgets/posts/editor/post_editor_thumbnail.dart index c133221..6ec3597 100644 --- a/lib/widgets/posts/editor/post_editor_thumbnail.dart +++ b/lib/widgets/posts/editor/post_editor_thumbnail.dart @@ -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 { _promptUploadNewAttachment(); }, ), - const SizedBox(height: 8), + const Gap(8), TextField( controller: _attachmentController, decoration: InputDecoration( diff --git a/lib/widgets/posts/editor/post_editor_visibility.dart b/lib/widgets/posts/editor/post_editor_visibility.dart index 973b5fa..1b6feaa 100644 --- a/lib/widgets/posts/editor/post_editor_visibility.dart +++ b/lib/widgets/posts/editor/post_editor_visibility.dart @@ -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(); }), diff --git a/lib/widgets/posts/editor/post_tags_field.dart b/lib/widgets/posts/editor/post_tags_field.dart index fce5476..476b764 100644 --- a/lib/widgets/posts/editor/post_tags_field.dart +++ b/lib/widgets/posts/editor/post_tags_field.dart @@ -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 { style: const TextStyle(color: Colors.white), ), ), - const SizedBox(width: 4.0), + const Gap(4), InkWell( child: const Icon( Icons.cancel, diff --git a/lib/widgets/posts/post_item.dart b/lib/widgets/posts/post_item.dart index 3bc1672..0934b5b 100644 --- a/lib/widgets/posts/post_item.dart +++ b/lib/widgets/posts/post_item.dart @@ -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 { bottom: 10, ) else - const SizedBox(height: 10), + const Gap(10), ], ), openBuilder: (_, __) => TitleShell( diff --git a/lib/widgets/posts/post_reaction.dart b/lib/widgets/posts/post_reaction.dart index e8a7a32..ff93da7 100644 --- a/lib/widgets/posts/post_reaction.dart +++ b/lib/widgets/posts/post_reaction.dart @@ -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)), diff --git a/lib/widgets/stickers/sticker_uploader.dart b/lib/widgets/stickers/sticker_uploader.dart index 7e6d897..7bd9d30 100644 --- a/lib/widgets/stickers/sticker_uploader.dart +++ b/lib/widgets/stickers/sticker_uploader.dart @@ -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 { _promptUploadNewAttachment(); }, ), - const SizedBox(height: 8), + const Gap(8), TextField( controller: _attachmentController, decoration: InputDecoration( @@ -138,7 +139,7 @@ class _StickerUploadDialogState extends State { ), onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(), ), - const SizedBox(height: 8), + const Gap(8), TextField( controller: _packController, decoration: InputDecoration(