opt: replace SizedBox with spacing (#863)

This commit is contained in:
My-Responsitories
2025-05-21 02:16:01 +08:00
committed by GitHub
parent 218e829fd4
commit 1efd62803a
8 changed files with 35 additions and 59 deletions

View File

@@ -85,6 +85,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 10,
children: [
Stack(
clipBehavior: Clip.none,
@@ -121,7 +122,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
),
],
),
const SizedBox(width: 10),
Expanded(
child: GestureDetector(
onTap: () => widget.showIntroDetail(
@@ -135,6 +135,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 20,
children: [
Expanded(
child: Text(
@@ -146,7 +147,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 20),
Obx(
() => FilledButton.tonal(
style: FilledButton.styleFrom(
@@ -204,6 +204,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
],
),
Row(
spacing: 6,
children: [
StatView(
context: context,
@@ -211,7 +212,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
value:
Utils.numFormat(bangumiItem.stat!['views']),
),
const SizedBox(width: 6),
StatDanMu(
context: context,
theme: 'gray',
@@ -219,9 +219,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
bangumiItem.stat!['danmakus']),
),
if (isLandscape) ...[
const SizedBox(width: 6),
areasAndPubTime(theme, bangumiItem),
const SizedBox(width: 6),
newEpDesc(theme, bangumiItem),
]
],
@@ -366,6 +364,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
VideoDetailController videoDetailCtr,
) {
return Row(
spacing: 8,
children: [
Obx(
() => ActionRowItem(
@@ -376,7 +375,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
text: bangumiItem.stat!['likes']!.toString(),
),
),
const SizedBox(width: 8),
Obx(
() => ActionRowItem(
icon: const Icon(FontAwesomeIcons.b),
@@ -386,7 +384,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
text: bangumiItem.stat!['coins']!.toString(),
),
),
const SizedBox(width: 8),
Obx(
() => ActionRowItem(
icon: const Icon(FontAwesomeIcons.heart),
@@ -398,7 +395,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
text: bangumiItem.stat!['favorite']!.toString(),
),
),
const SizedBox(width: 8),
ActionRowItem(
icon: const Icon(FontAwesomeIcons.comment),
onTap: () {
@@ -408,7 +404,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
isLoading: false,
text: bangumiItem.stat!['reply']!.toString(),
),
const SizedBox(width: 8),
ActionRowItem(
icon: const Icon(FontAwesomeIcons.share),
onTap: () => bangumiIntroController.actionShareVideo(context),
@@ -422,6 +417,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
Widget areasAndPubTime(ThemeData theme, BangumiInfoModel bangumiItem) {
return Row(
spacing: 6,
children: [
Text(
(bangumiItem.areas!.isNotEmpty
@@ -432,7 +428,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
color: theme.colorScheme.outline,
),
),
const SizedBox(width: 6),
Text(
bangumiItem.publish!['pub_time_show'],
style: TextStyle(