🎨 Use Gap instead of empty SizedBox
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package: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(
|
||||
|
@ -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(
|
||||
|
@ -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: [
|
||||
|
@ -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: [
|
||||
|
@ -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}'),
|
||||
)
|
||||
|
@ -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: [
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user