refactor(media): compact browsing controls and isolate asset row updates

This commit is contained in:
lingjhf committed 2026-10-09 19:23:49 +08:00
1 parent 1acfe4a005
commit 107e93b959
8 files changed
+287 -257

No files matched your search

+26 -27
View File
@@ -115,9 +115,13 @@ class _ResourceSectionTabsState extends State<ResourceSectionTabs> {
final l10n = AppLocalizations.of(context)!;
return SizedBox(
key: const Key('resource-section-tabs'),
height: 36,
height: AppDesktopMetrics.timelineTabs,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
padding: const EdgeInsetsDirectional.only(
start: AppSpacing.small,
top: 4,
bottom: 4,
),
child: ScrollEdgeFade(
controller: _scrollController,
axis: Axis.horizontal,
@@ -127,35 +131,30 @@ class _ResourceSectionTabsState extends State<ResourceSectionTabs> {
key: const Key('resource-tabs-list'),
controller: _scrollController,
scrollDirection: Axis.horizontal,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Row(
children: [
for (final section in ResourceSection.values) ...[
if (section != ResourceSection.values.first)
const SizedBox(width: 4),
KeyedSubtree(
key: widget.selected == section
? _selectedTabKey
: null,
child: Semantics(
selected: widget.selected == section,
child: TextButton(
key: ValueKey('resource-tab-${section.name}'),
style: AppTheme.timelineTabStyle(
context,
selected: widget.selected == section,
),
onPressed: widget.onSelected == null
? null
: () => widget.onSelected!(section),
child: Text(section.label(l10n), maxLines: 1),
child: Row(
children: [
for (final section in ResourceSection.values) ...[
if (section != ResourceSection.values.first)
const SizedBox(width: AppSpacing.tiny),
KeyedSubtree(
key: widget.selected == section ? _selectedTabKey : null,
child: Semantics(
selected: widget.selected == section,
child: TextButton(
key: ValueKey('resource-tab-${section.name}'),
style: AppTheme.timelineTabStyle(
context,
selected: widget.selected == section,
),
onPressed: widget.onSelected == null
? null
: () => widget.onSelected!(section),
child: Text(section.label(l10n), maxLines: 1),
),
),
],
),
],
),
],
),
),
),