mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: fix SliverLayoutBuilder rebuilds too much
This commit is contained in:
parent
53ef9e15e1
commit
3b21b05fdc
@ -55,37 +55,35 @@ class TrackPresentation extends HookConsumerWidget {
|
|||||||
slivers: [
|
slivers: [
|
||||||
const TrackPresentationTopSection(),
|
const TrackPresentationTopSection(),
|
||||||
const SliverGap(16),
|
const SliverGap(16),
|
||||||
SliverLayoutBuilder(
|
SliverList.list(
|
||||||
builder: (context, constrains) {
|
children: [
|
||||||
return SliverList.list(
|
TrackPresentationModifiersSection(
|
||||||
children: [
|
focusNode: focusNode,
|
||||||
TrackPresentationModifiersSection(
|
),
|
||||||
focusNode: focusNode,
|
LayoutBuilder(builder: (context, constrains) {
|
||||||
|
return Basic(
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 8,
|
||||||
|
horizontal: 16,
|
||||||
),
|
),
|
||||||
Basic(
|
leading: constrains.mdAndUp ? const Text(" #") : null,
|
||||||
padding: const EdgeInsets.symmetric(
|
title: Row(
|
||||||
vertical: 8,
|
children: [
|
||||||
horizontal: 16,
|
Expanded(
|
||||||
),
|
flex: constrains.lgAndUp ? 5 : 6,
|
||||||
leading: constrains.mdAndUp ? const Text(" #") : null,
|
child: Text(context.l10n.title),
|
||||||
title: Row(
|
),
|
||||||
children: [
|
if (constrains.mdAndUp)
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: constrains.lgAndUp ? 5 : 6,
|
flex: 3,
|
||||||
child: Text(context.l10n.title),
|
child: Text(context.l10n.album),
|
||||||
),
|
),
|
||||||
if (constrains.mdAndUp)
|
Text(context.l10n.duration),
|
||||||
Expanded(
|
],
|
||||||
flex: 3,
|
),
|
||||||
child: Text(context.l10n.album),
|
).small().muted();
|
||||||
),
|
}),
|
||||||
Text(context.l10n.duration),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
).small().muted(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const PresentationListSection(),
|
const PresentationListSection(),
|
||||||
const SliverSafeArea(sliver: SliverGap(10)),
|
const SliverSafeArea(sliver: SliverGap(10)),
|
||||||
|
Loading…
Reference in New Issue
Block a user