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

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher_string.dart'; import 'package:url_launcher/url_launcher_string.dart';
@ -21,7 +22,7 @@ class AboutScreen extends StatelessWidget {
borderRadius: const BorderRadius.all(Radius.circular(16)), borderRadius: const BorderRadius.all(Radius.circular(16)),
child: Image.asset('assets/logo.png', width: 120, height: 120), child: Image.asset('assets/logo.png', width: 120, height: 120),
), ),
const SizedBox(height: 8), const Gap(8),
Text( Text(
'Solian', 'Solian',
style: Theme.of(context).textTheme.headlineMedium, style: Theme.of(context).textTheme.headlineMedium,
@ -30,7 +31,7 @@ class AboutScreen extends StatelessWidget {
'The Solar Network', 'The Solar Network',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
), ),
const SizedBox(height: 8), const Gap(8),
FutureBuilder( FutureBuilder(
future: PackageInfo.fromPlatform(), future: PackageInfo.fromPlatform(),
builder: (context, snapshot) { builder: (context, snapshot) {
@ -45,7 +46,7 @@ class AboutScreen extends StatelessWidget {
}, },
), ),
Text('Copyright © ${DateTime.now().year} Solsynth LLC'), Text('Copyright © ${DateTime.now().year} Solsynth LLC'),
const SizedBox(height: 16), const Gap(16),
TextButton( TextButton(
style: denseButtonStyle, style: denseButtonStyle,
child: const Text('App Details'), 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.', '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( applicationIcon: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(16)), 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'); launchUrlString('https://solsynth.dev/products/solar-network');
}, },
), ),
const SizedBox(height: 16), const Gap(16),
const Text( const Text(
'Open-sourced under AGPLv3', 'Open-sourced under AGPLv3',
style: TextStyle( style: TextStyle(

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
import 'package:solian/models/relations.dart'; import 'package:solian/models/relations.dart';
@ -56,7 +57,7 @@ class _FriendScreenState extends State<FriendScreen>
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text('accountFriendNewHint'.tr, textAlign: TextAlign.left), Text('accountFriendNewHint'.tr, textAlign: TextAlign.left),
const SizedBox(height: 18), const Gap(18),
TextField( TextField(
controller: controller, controller: controller,
decoration: InputDecoration( decoration: InputDecoration(

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
import 'package:solian/services.dart'; import 'package:solian/services.dart';
@ -94,7 +95,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
onTapOutside: (_) => onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(), FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 12), const Gap(12),
TextField( TextField(
autocorrect: false, autocorrect: false,
enableSuggestions: false, enableSuggestions: false,
@ -108,7 +109,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
onTapOutside: (_) => onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(), FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 12), const Gap(12),
TextField( TextField(
autocorrect: false, autocorrect: false,
enableSuggestions: false, enableSuggestions: false,
@ -122,7 +123,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
onTapOutside: (_) => onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(), FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 12), const Gap(12),
TextField( TextField(
obscureText: true, obscureText: true,
autocorrect: false, autocorrect: false,
@ -138,7 +139,7 @@ class _SignUpPopupState extends State<SignUpPopup> {
FocusManager.instance.primaryFocus?.unfocus(), FocusManager.instance.primaryFocus?.unfocus(),
onSubmitted: (_) => performAction(context), onSubmitted: (_) => performAction(context),
), ),
const SizedBox(height: 16), const Gap(16),
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: TextButton( child: TextButton(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:solian/models/account.dart'; import 'package:solian/models/account.dart';
@ -150,7 +151,7 @@ class AccountHeadingWidget extends StatelessWidget {
), ),
], ],
).paddingOnly(left: 116, top: 6), ).paddingOnly(left: 116, top: 6),
const SizedBox(height: 4), const Gap(4),
if (badges?.isNotEmpty ?? false) if (badges?.isNotEmpty ?? false)
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/account.dart'; import 'package:solian/models/account.dart';
import 'package:solian/providers/account_status.dart'; import 'package:solian/providers/account_status.dart';
@ -72,7 +73,7 @@ class _AccountProfilePopupState extends State<AccountProfilePopup> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Icon(Icons.cancel, size: 24), const Icon(Icons.cancel, size: 24),
const SizedBox(height: 12), const Gap(12),
Text( Text(
_hasError.toString(), _hasError.toString(),
textAlign: TextAlign.center, textAlign: TextAlign.center,

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
@ -214,7 +215,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
child: const LinearProgressIndicator().animate().scaleX(), child: const LinearProgressIndicator().animate().scaleX(),
), ),
const SizedBox(height: 18), const Gap(18),
TextField( TextField(
controller: _labelController, controller: _labelController,
decoration: InputDecoration( decoration: InputDecoration(
@ -226,7 +227,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
onTapOutside: (_) => onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(), FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 8), const Gap(8),
TextField( TextField(
controller: _clearAtController, controller: _clearAtController,
readOnly: true, readOnly: true,
@ -238,7 +239,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
), ),
onTap: () => selectClearAt(), onTap: () => selectClearAt(),
), ),
const SizedBox(height: 8), const Gap(8),
SingleChildScrollView( SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Wrap( child: Wrap(
@ -281,7 +282,7 @@ class _AccountStatusEditorDialogState extends State<AccountStatusEditorDialog> {
], ],
), ),
), ),
const SizedBox(height: 8), const Gap(8),
SingleChildScrollView( SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Wrap( child: Wrap(

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/screens/auth/signin.dart'; import 'package:solian/screens/auth/signin.dart';
@ -20,7 +21,7 @@ class SigninRequiredOverlay extends StatelessWidget {
Icons.login, Icons.login,
size: 48, size: 48,
), ),
const SizedBox(height: 8), const Gap(8),
Text( Text(
'signinRequired'.tr, 'signinRequired'.tr,
style: Theme.of(context).textTheme.titleLarge, style: Theme.of(context).textTheme.titleLarge,

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
import 'package:solian/models/attachment.dart'; import 'package:solian/models/attachment.dart';
@ -74,7 +75,7 @@ class _AttachmentAttrEditorDialogState
borderRadius: const BorderRadius.all(Radius.circular(8)), borderRadius: const BorderRadius.all(Radius.circular(8)),
child: const LinearProgressIndicator().animate().scaleX(), child: const LinearProgressIndicator().animate().scaleX(),
), ),
const SizedBox(height: 18), const Gap(18),
TextField( TextField(
controller: _altController, controller: _altController,
decoration: InputDecoration( decoration: InputDecoration(
@ -86,7 +87,7 @@ class _AttachmentAttrEditorDialogState
onTapOutside: (_) => onTapOutside: (_) =>
FocusManager.instance.primaryFocus?.unfocus(), FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 8), const Gap(8),
CheckboxListTile( CheckboxListTile(
contentPadding: const EdgeInsets.only(left: 4, right: 18), contentPadding: const EdgeInsets.only(left: 4, right: 18),
shape: const RoundedRectangleBorder( 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:file_picker/file_picker.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:image_cropper/image_cropper.dart'; import 'package:image_cropper/image_cropper.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
@ -144,7 +145,7 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text('attachmentAddLinkHint'.tr, textAlign: TextAlign.left), Text('attachmentAddLinkHint'.tr, textAlign: TextAlign.left),
const SizedBox(height: 18), const Gap(18),
TextField( TextField(
controller: controller, controller: controller,
decoration: InputDecoration( decoration: InputDecoration(
@ -353,7 +354,7 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
); );
}, },
), ),
const SizedBox(width: 6), const Gap(6),
if (element.progress != null) if (element.progress != null)
Text( Text(
'${(element.progress! * 100).toStringAsFixed(2)}%', '${(element.progress! * 100).toStringAsFixed(2)}%',
@ -614,7 +615,7 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
const SizedBox(width: 10), const Gap(10),
Obx(() { Obx(() {
if (_uploadController.isUploading.value) { if (_uploadController.isUploading.value) {
return SizedBox( return SizedBox(
@ -635,9 +636,9 @@ class _AttachmentEditorPopupState extends State<AttachmentEditorPopup> {
], ],
), ),
), ),
const SizedBox(width: 20), const Gap(20),
Text('attachmentAutoUpload'.tr), Text('attachmentAutoUpload'.tr),
const SizedBox(width: 8), const Gap(8),
Switch( Switch(
value: _isAutoUpload, value: _isAutoUpload,
onChanged: (bool? value) { onChanged: (bool? value) {

View File

@ -6,6 +6,7 @@ import 'package:dismissible_page/dismissible_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:gal/gal.dart'; import 'package:gal/gal.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
import 'package:solian/models/attachment.dart'; import 'package:solian/models/attachment.dart';
@ -198,7 +199,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
radius: 19, radius: 19,
), ),
), ),
const IgnorePointer(child: SizedBox(width: 8)), const IgnorePointer(child: Gap(8)),
Expanded( Expanded(
child: IgnorePointer( child: IgnorePointer(
child: Column( child: Column(
@ -240,7 +241,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
), ),
], ],
), ),
const IgnorePointer(child: SizedBox(height: 4)), const IgnorePointer(child: Gap(4)),
IgnorePointer( IgnorePointer(
child: Text( child: Text(
widget.item.alt, widget.item.alt,
@ -252,7 +253,7 @@ class _AttachmentFullScreenState extends State<AttachmentFullScreen> {
), ),
), ),
), ),
const IgnorePointer(child: SizedBox(height: 2)), const IgnorePointer(child: Gap(2)),
IgnorePointer( IgnorePointer(
child: Wrap( child: Wrap(
spacing: 6, spacing: 6,

View File

@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:media_kit/media_kit.dart'; import 'package:media_kit/media_kit.dart';
import 'package:media_kit_video/media_kit_video.dart'; import 'package:media_kit_video/media_kit_video.dart';
@ -65,7 +66,7 @@ class _AttachmentItemState extends State<AttachmentItem> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Icon(Icons.file_present, size: 32), const Icon(Icons.file_present, size: 32),
const SizedBox(height: 6), const Gap(6),
Text( Text(
widget.item.mimetype, widget.item.mimetype,
style: TextStyle( style: TextStyle(
@ -74,13 +75,13 @@ class _AttachmentItemState extends State<AttachmentItem> {
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
const SizedBox(height: 2), const Gap(2),
Text( Text(
widget.item.alt, widget.item.alt,
style: const TextStyle(fontSize: 13), style: const TextStyle(fontSize: 13),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
const SizedBox(height: 12), const Gap(12),
TextButton.icon( TextButton.icon(
icon: const Icon(Icons.launch), icon: const Icon(Icons.launch),
label: Text('openInBrowser'.tr), label: Text('openInBrowser'.tr),
@ -282,7 +283,7 @@ class _AttachmentItemVideoState extends State<_AttachmentItemVideo> {
color: Colors.white, color: Colors.white,
size: 32, size: 32,
), ),
const SizedBox(height: 8), const Gap(8),
Text( Text(
'attachmentUnload'.tr, 'attachmentUnload'.tr,
style: const TextStyle( 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:dismissible_page/dismissible_page.dart';
import 'package:flutter/material.dart' hide CarouselController; import 'package:flutter/material.dart' hide CarouselController;
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/attachment.dart'; import 'package:solian/models/attachment.dart';
import 'package:solian/widgets/attachments/attachment_item.dart'; import 'package:solian/widgets/attachments/attachment_item.dart';
@ -359,7 +360,7 @@ class AttachmentListEntry extends StatelessWidget {
color: Colors.white, color: Colors.white,
size: 32, size: 32,
), ),
if (!isDense) const SizedBox(height: 8), if (!isDense) const Gap(8),
if (!isDense) if (!isDense)
Text( Text(
'matureContent'.tr, 'matureContent'.tr,

View File

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:avatar_stack/avatar_stack.dart'; import 'package:avatar_stack/avatar_stack.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/account.dart'; import 'package:solian/models/account.dart';
import 'package:solian/models/call.dart'; import 'package:solian/models/call.dart';
@ -60,7 +61,7 @@ class ChannelCallIndicator extends StatelessWidget {
})); }));
} }
}), }),
const SizedBox(width: 6), const Gap(6),
Obx(() { Obx(() {
if (call.isInitialized.value) { if (call.isInitialized.value) {
return const SizedBox(); return const SizedBox();

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:livekit_client/livekit_client.dart'; import 'package:livekit_client/livekit_client.dart';
@ -35,7 +36,7 @@ class ParticipantInfoWidget extends StatelessWidget {
style: const TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
), ),
), ),
const SizedBox(width: 5), const Gap(5),
isScreenShare isScreenShare
? const Icon( ? const Icon(
Icons.monitor, Icons.monitor,
@ -47,7 +48,7 @@ class ParticipantInfoWidget extends StatelessWidget {
color: audioAvailable ? Colors.white : Colors.red, color: audioAvailable ? Colors.white : Colors.red,
size: 16, size: 16,
), ),
const SizedBox(width: 3), const Gap(3),
if (connectionQuality != ConnectionQuality.unknown) if (connectionQuality != ConnectionQuality.unknown)
Icon( Icon(
{ {

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/controllers/chat_events_controller.dart'; import 'package:solian/controllers/chat_events_controller.dart';
import 'package:solian/models/event.dart'; import 'package:solian/models/event.dart';
@ -214,7 +215,7 @@ class ChatEvent extends StatelessWidget {
opacity: 0.75, opacity: 0.75,
child: FaIcon(FontAwesomeIcons.quoteLeft, size: 14), child: FaIcon(FontAwesomeIcons.quoteLeft, size: 14),
).paddingOnly(bottom: 2.75), ).paddingOnly(bottom: 2.75),
const SizedBox(width: 4), const Gap(4),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -226,12 +227,12 @@ class ChatEvent extends StatelessWidget {
content: item.sender.account.avatar, content: item.sender.account.avatar,
radius: 9, radius: 9,
), ),
const SizedBox(width: 5), const Gap(5),
Text( Text(
item.sender.account.nick, item.sender.account.nick,
style: const TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
), ),
const SizedBox(width: 4), const Gap(4),
Text(format(item.createdAt, locale: 'en_short')), Text(format(item.createdAt, locale: 'en_short')),
], ],
), ),
@ -275,7 +276,7 @@ class ChatEvent extends StatelessWidget {
item.sender.account.nick, item.sender.account.nick,
style: const TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
), ),
const SizedBox(width: 4), const Gap(4),
Text(format(item.createdAt, locale: 'en_short')) Text(format(item.createdAt, locale: 'en_short'))
], ],
).paddingSymmetric(horizontal: 12), ).paddingSymmetric(horizontal: 12),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
class ChatEventMessageActionLog extends StatelessWidget { class ChatEventMessageActionLog extends StatelessWidget {
@ -25,7 +26,7 @@ class ChatEventMessageActionLog extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
icon, icon,
const SizedBox(width: 4), const Gap(4),
Text(text), Text(text),
], ],
).paddingOnly( ).paddingOnly(

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/channel.dart'; import 'package:solian/models/channel.dart';
@ -47,7 +48,7 @@ class _ChatTypingIndicatorState extends State<ChatTypingIndicator>
child: Row( child: Row(
children: [ children: [
const Icon(Icons.more_horiz), const Icon(Icons.more_horiz),
const SizedBox(width: 6), const Gap(6),
Text('typingMessage'.trParams({ Text('typingMessage'.trParams({
'user': widget.users.map((x) => x.account.nick).join(', '), 'user': widget.users.map((x) => x.account.nick).join(', '),
})), })),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:solian/controllers/post_editor_controller.dart'; import 'package:solian/controllers/post_editor_controller.dart';
@ -86,7 +87,7 @@ class _PostEditorDateDialogState extends State<PostEditorDateDialog> {
), ),
onTap: () => _selectDate(0), onTap: () => _selectDate(0),
), ),
const SizedBox(height: 16), const Gap(16),
TextField( TextField(
controller: _publishedUntilController, controller: _publishedUntilController,
readOnly: true, readOnly: true,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/controllers/post_editor_controller.dart'; import 'package:solian/controllers/post_editor_controller.dart';
@ -25,7 +26,7 @@ class PostEditorOverviewDialog extends StatelessWidget {
), ),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(), onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 16), const Gap(16),
TextField( TextField(
autofocus: true, autofocus: true,
autocorrect: true, autocorrect: true,
@ -37,7 +38,7 @@ class PostEditorOverviewDialog extends StatelessWidget {
), ),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(), onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 16), const Gap(16),
TextField( TextField(
enabled: controller.mode.value == 1, enabled: controller.mode.value == 1,
maxLines: null, maxLines: null,

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/controllers/post_editor_controller.dart'; import 'package:solian/controllers/post_editor_controller.dart';
import 'package:solian/widgets/attachments/attachment_editor.dart'; import 'package:solian/widgets/attachments/attachment_editor.dart';
@ -68,7 +69,7 @@ class _PostEditorThumbnailDialogState extends State<PostEditorThumbnailDialog> {
_promptUploadNewAttachment(); _promptUploadNewAttachment();
}, },
), ),
const SizedBox(height: 8), const Gap(8),
TextField( TextField(
controller: _attachmentController, controller: _attachmentController,
decoration: InputDecoration( decoration: InputDecoration(

View File

@ -1,5 +1,6 @@
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/controllers/post_editor_controller.dart'; import 'package:solian/controllers/post_editor_controller.dart';
import 'package:solian/widgets/account/account_select.dart'; import 'package:solian/widgets/account/account_select.dart';
@ -56,7 +57,7 @@ class PostEditorVisibilityDialog extends StatelessWidget {
Obx(() { Obx(() {
if (controller.visibility.value == 2 || if (controller.visibility.value == 2 ||
controller.visibility.value == 3) { controller.visibility.value == 3) {
return const SizedBox(height: 8); return const Gap(8);
} }
return const SizedBox(); return const SizedBox();
}), }),

View File

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/services.dart'; import 'package:solian/services.dart';
@ -111,7 +112,7 @@ class _TagsFieldState extends State<TagsField> {
style: const TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
), ),
), ),
const SizedBox(width: 4.0), const Gap(4),
InkWell( InkWell(
child: const Icon( child: const Icon(
Icons.cancel, Icons.cancel,

View File

@ -2,6 +2,7 @@ import 'package:animations/animations.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.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:get/get_utils/get_utils.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:solian/models/post.dart'; import 'package:solian/models/post.dart';
@ -519,7 +520,7 @@ class _PostItemState extends State<PostItem> {
bottom: 10, bottom: 10,
) )
else else
const SizedBox(height: 10), const Gap(10),
], ],
), ),
openBuilder: (_, __) => TitleShell( openBuilder: (_, __) => TitleShell(

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/reaction.dart'; import 'package:solian/models/reaction.dart';
@ -33,9 +34,11 @@ class PostReactionPopup extends StatelessWidget {
label: Row( label: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text(e.key, Text(
style: const TextStyle(fontFamily: 'monospace')), e.key,
const SizedBox(width: 6), style: const TextStyle(fontFamily: 'monospace'),
),
const Gap(6),
Text('x${reactionList[e.key]?.toString() ?? '0'}', Text('x${reactionList[e.key]?.toString() ?? '0'}',
style: style:
const TextStyle(fontWeight: FontWeight.bold)), const TextStyle(fontWeight: FontWeight.bold)),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/exts.dart'; import 'package:solian/exts.dart';
import 'package:solian/models/stickers.dart'; import 'package:solian/models/stickers.dart';
@ -127,7 +128,7 @@ class _StickerUploadDialogState extends State<StickerUploadDialog> {
_promptUploadNewAttachment(); _promptUploadNewAttachment();
}, },
), ),
const SizedBox(height: 8), const Gap(8),
TextField( TextField(
controller: _attachmentController, controller: _attachmentController,
decoration: InputDecoration( decoration: InputDecoration(
@ -138,7 +139,7 @@ class _StickerUploadDialogState extends State<StickerUploadDialog> {
), ),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(), onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
), ),
const SizedBox(height: 8), const Gap(8),
TextField( TextField(
controller: _packController, controller: _packController,
decoration: InputDecoration( decoration: InputDecoration(