🎨 Use SizedBox.shrink instead of empty SizedBox for placeholder

This commit is contained in:
2024-09-07 17:48:07 +08:00
parent 85f97521e5
commit 4e8f2ddef3
20 changed files with 37 additions and 36 deletions

View File

@@ -36,7 +36,7 @@ class AboutScreen extends StatelessWidget {
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const SizedBox();
return const SizedBox.shrink();
}
return Text(

View File

@@ -84,7 +84,7 @@ class _CallScreenState extends State<CallScreen> with TickerProviderStateMixin {
participant: call.focusTrack.value!,
onTap: () {},
)
: const SizedBox(),
: const SizedBox.shrink(),
),
Positioned(
left: 0,

View File

@@ -222,7 +222,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
actions: [
const BackgroundStateWidget(),
Builder(builder: (context) {
if (_isBusy || _channel == null) return const SizedBox();
if (_isBusy || _channel == null) return const SizedBox.shrink();
return ChatCallButton(
realm: _channel!.realm,
@@ -299,7 +299,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
if (_chatController.isLoading.isTrue) {
return const LinearProgressIndicator().animate().slideY();
} else {
return const SizedBox();
return const SizedBox.shrink();
}
}),
ClipRect(
@@ -350,7 +350,7 @@ class _ChannelChatScreenState extends State<ChannelChatScreen>
]),
);
}
return const SizedBox();
return const SizedBox.shrink();
}),
],
);

View File

@@ -112,7 +112,7 @@ class _ChatScreenState extends State<ChatScreen> {
children: [
Obx(() {
if (_channels.isLoading.isFalse) {
return const SizedBox();
return const SizedBox.shrink();
} else {
return const LinearProgressIndicator();
}

View File

@@ -190,7 +190,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
icon: const Icon(Icons.local_fire_department),
onPressed: _signingDaily ? null : _signDaily,
)
: const SizedBox(),
: const SizedBox.shrink(),
),
),
).paddingSymmetric(horizontal: 8),

View File

@@ -155,7 +155,7 @@ class PostCreatePopup extends StatelessWidget {
final AuthProvider auth = Get.find();
if (auth.isAuthorized.isFalse) {
return const SizedBox();
return const SizedBox.shrink();
}
final List<dynamic> actionList = [