fix:持仓详情编辑,资讯下拉加载更多

This commit is contained in:
jingyun
2026-06-22 11:36:09 +08:00
parent 08023aff82
commit ab99010306
15 changed files with 1504 additions and 186 deletions
@@ -93,32 +93,30 @@ class MarketPage extends HookConsumerWidget {
],
),
const SizedBox(height: 14),
SizedBox(
height: 32,
child: ListView.separated(
scrollDirection: Axis.horizontal,
physics: const BouncingScrollPhysics(),
itemCount: MetalType.values.length,
separatorBuilder: (context, index) =>
Row(
children: [
for (var i = 0; i < MetalType.values.length; i++) ...[
Expanded(
child: _MetalTab(
label: MetalType.values[i].label,
selected: MetalType.values[i] == market.selectedMetal,
onTap: () {
final metal = MetalType.values[i];
ref
.read(marketControllerProvider.notifier)
.selectMetal(metal);
ref
.read(
exchangeCalculatorControllerProvider.notifier,
)
.selectMetal(metal);
},
),
),
if (i != MetalType.values.length - 1)
const SizedBox(width: 8),
itemBuilder: (context, index) {
final metal = MetalType.values[index];
return PrototypePill(
label: metal.label,
selected: metal == market.selectedMetal,
onTap: () {
ref
.read(marketControllerProvider.notifier)
.selectMetal(metal);
ref
.read(
exchangeCalculatorControllerProvider.notifier,
)
.selectMetal(metal);
},
);
},
),
],
],
),
const SizedBox(height: 10),
PrototypeCard(
@@ -501,6 +499,46 @@ class _PeriodPill extends StatelessWidget {
}
}
class _MetalTab extends StatelessWidget {
const _MetalTab({
required this.label,
required this.selected,
required this.onTap,
});
final String label;
final bool selected;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(12),
child: Container(
height: 32,
alignment: Alignment.center,
decoration: BoxDecoration(
color: selected ? const Color(0xFFF6ECD6) : Colors.white,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: selected ? const Color(0xFFE3D6B4) : const Color(0xFFE6E1D8),
width: 0.5,
),
),
child: Text(
label,
style: TextStyle(
fontSize: 13,
fontWeight: selected ? FontWeight.w600 : FontWeight.w500,
color: selected ? const Color(0xFF7A5B12) : const Color(0xFF6E6A60),
),
),
),
);
}
}
class _ChangeChip extends StatelessWidget {
const _ChangeChip({
required this.amount,