fix:靠原型不齐页面
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,262 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../../common/domain/money.dart';
|
||||
import '../../../common/widgets/prototype_ui.dart';
|
||||
import '../application/asset_portfolio_controller.dart';
|
||||
|
||||
class HoldingDetailPage extends ConsumerWidget {
|
||||
const HoldingDetailPage({super.key, this.id});
|
||||
|
||||
final String? id;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final summary = ref.watch(assetPortfolioControllerProvider);
|
||||
final holding = summary.holdings
|
||||
.map((item) => item.holding)
|
||||
.firstWhere(
|
||||
(item) => id == null || item.id == id,
|
||||
orElse: () => summary.holdings.first.holding,
|
||||
);
|
||||
final valuation = summary.holdings
|
||||
.firstWhere((item) => item.holding.id == holding.id);
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
final changeUp = valuation.todayChange >= 0;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFFBFAF7),
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFFFBFAF7),
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
icon: const Icon(Icons.chevron_left, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
holding.name,
|
||||
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 28),
|
||||
children: [
|
||||
PrototypeFrame(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
PrototypeCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 36,
|
||||
height: 36,
|
||||
decoration: BoxDecoration(
|
||||
color: holding.metal.color.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(Icons.circle_outlined, color: holding.metal.color, size: 18),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
'${holding.purityLabel} · ${holding.weightGram.toStringAsFixed(1)}g',
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'¥',
|
||||
style: TextStyle(fontSize: 22, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
formatCny(valuation.materialValue).replaceFirst('¥', ''),
|
||||
style: const TextStyle(
|
||||
fontSize: 42,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -1,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
_ChangeChip(
|
||||
amount: valuation.todayChange,
|
||||
positive: changeUp,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'今日',
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
_InfoRow(label: '材料价值(现货)', value: formatCny(valuation.materialValue)),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_InfoRow(label: '回收参考价', value: formatCny(valuation.materialValue * 0.97)),
|
||||
if (holding.costAmount != null) ...[
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_InfoRow(label: '买入成本', value: formatCny(holding.costAmount!)),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_InfoRow(
|
||||
label: '盈亏',
|
||||
value: _signedCny(valuation.materialValue - holding.costAmount!),
|
||||
valueColor: valuation.materialValue - holding.costAmount! >= 0
|
||||
? const Color(0xFFC0392B)
|
||||
: const Color(0xFF2E8B6F),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
_InfoRow(label: '金属 / 纯度', value: '${holding.metal.label} · ${holding.purityLabel}'),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_InfoRow(label: '克重', value: '${holding.weightGram.toStringAsFixed(1)} g'),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_InfoRow(label: '购买日期', value: _dateLabel(holding.purchaseDate)),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_InfoRow(label: '购买渠道', value: holding.channel ?? '未填'),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
child: GestureDetector(
|
||||
onTap: () {},
|
||||
child: SizedBox(
|
||||
height: 156,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: PrototypeLineChart(
|
||||
values: const [18, 20, 21, 23, 22, 25, 29, 31, 30, 33, 35, 37],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: OutlinedButton(
|
||||
onPressed: () => _showAction(context, '编辑'),
|
||||
child: const Text('编辑'),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: OutlinedButton(
|
||||
onPressed: () => _showAction(context, '标记卖出 / 转赠'),
|
||||
child: const Text('标记卖出 / 转赠'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showAction(BuildContext context, String text) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('$text 占位')));
|
||||
}
|
||||
}
|
||||
|
||||
class _InfoRow extends StatelessWidget {
|
||||
const _InfoRow({
|
||||
required this.label,
|
||||
required this.value,
|
||||
this.valueColor,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final String value;
|
||||
final Color? valueColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 11),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(label, style: TextStyle(fontSize: 13, color: cs.mutedForeground)),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: valueColor ?? cs.foreground),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ChangeChip extends StatelessWidget {
|
||||
const _ChangeChip({required this.amount, required this.positive});
|
||||
|
||||
final double amount;
|
||||
final bool positive;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: positive ? const Color(0xFFFBEDEA) : const Color(0xFFE7F2EE),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: Text(
|
||||
'${positive ? '↑' : '↓'}${formatCny(amount.abs())} · ${positive ? '+' : '-'}${amount.abs().toStringAsFixed(2)}',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: positive ? const Color(0xFFC0392B) : const Color(0xFF2E8B6F),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _dateLabel(DateTime? value) {
|
||||
if (value == null) return '未填';
|
||||
return '${value.year}-${value.month.toString().padLeft(2, '0')}-${value.day.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
String _signedCny(double value) {
|
||||
final sign = value >= 0 ? '+' : '-';
|
||||
return '$sign${formatCny(value.abs())}';
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../../common/domain/metal_type.dart';
|
||||
import '../../../common/widgets/prototype_ui.dart';
|
||||
import '../data/mock_market_repository.dart';
|
||||
import '../data/market_models.dart';
|
||||
|
||||
class MarketKlinePage extends ConsumerWidget {
|
||||
const MarketKlinePage({super.key, this.metalId, this.periodId});
|
||||
|
||||
final String? metalId;
|
||||
final String? periodId;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final repo = ref.watch(mockMarketRepositoryProvider);
|
||||
final metal = _metalFromId(metalId) ?? MetalType.gold;
|
||||
final period = _periodFromId(periodId) ?? MarketPeriod.h24;
|
||||
final quote = repo.quoteFor(metal);
|
||||
final points = repo.chartFor(metal, period);
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFFBFAF7),
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFFFBFAF7),
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
icon: const Icon(Icons.chevron_left, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
'${metal.label} K线',
|
||||
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
|
||||
children: [
|
||||
PrototypeFrame(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
PrototypeCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'¥',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: cs.foreground,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
quote.spotPrice.toStringAsFixed(2),
|
||||
style: const TextStyle(
|
||||
fontSize: 29,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: -1,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 8),
|
||||
child: Text('元/克', style: TextStyle(fontSize: 12, color: Color(0xFF8A8780))),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'${quote.changeAmount >= 0 ? '+' : ''}${quote.changeAmount.toStringAsFixed(2)} · ${quote.changePercent.toStringAsFixed(2)}%',
|
||||
style: TextStyle(
|
||||
color: quote.changeAmount >= 0
|
||||
? const Color(0xFFC0392B)
|
||||
: const Color(0xFF2E8B6F),
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
for (final p in MarketPeriod.values)
|
||||
PrototypePill(
|
||||
label: p.label,
|
||||
selected: p == period,
|
||||
onTap: () => Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => MarketKlinePage(
|
||||
metalId: metal.id,
|
||||
periodId: p.id,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
_Ohlc('开', points.first.open),
|
||||
const SizedBox(width: 18),
|
||||
_Ohlc('高', points.map((e) => e.high).reduce((a, b) => a > b ? a : b)),
|
||||
const SizedBox(width: 18),
|
||||
_Ohlc('低', points.map((e) => e.low).reduce((a, b) => a < b ? a : b)),
|
||||
const SizedBox(width: 18),
|
||||
_Ohlc('收', points.last.close),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(
|
||||
height: 300,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: PrototypeLineChart(
|
||||
values: points.map((p) => p.close).toList(growable: false),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'${quote.basisLabel} · ${_timeLabel(quote.updatedAt)}',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 11, color: cs.mutedForeground),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _Ohlc extends StatelessWidget {
|
||||
const _Ohlc(this.label, this.value);
|
||||
|
||||
final String label;
|
||||
final double value;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(label, style: const TextStyle(fontSize: 12, color: Color(0xFF8A8780))),
|
||||
const SizedBox(height: 2),
|
||||
Text(value.toStringAsFixed(2), style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w600)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
MetalType? _metalFromId(String? id) {
|
||||
return switch (id) {
|
||||
'gold' => MetalType.gold,
|
||||
'platinum' => MetalType.platinum,
|
||||
'silver' => MetalType.silver,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
MarketPeriod? _periodFromId(String? id) {
|
||||
return switch (id) {
|
||||
'24h' => MarketPeriod.h24,
|
||||
'5d' => MarketPeriod.d5,
|
||||
'1m' => MarketPeriod.m1,
|
||||
'3m' => MarketPeriod.m3,
|
||||
'1y' => MarketPeriod.y1,
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
String _timeLabel(DateTime value) {
|
||||
return '${value.hour.toString().padLeft(2, '0')}:${value.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
@@ -1,149 +1,314 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../../common/domain/metal_type.dart';
|
||||
import '../../../common/domain/money.dart';
|
||||
import '../../../common/widgets/adaptive.dart';
|
||||
import '../../../common/router/app_router.dart';
|
||||
import '../../../common/widgets/prototype_ui.dart';
|
||||
import '../application/exchange_calculator_controller.dart';
|
||||
import '../application/market_controller.dart';
|
||||
import '../data/market_models.dart';
|
||||
|
||||
class MarketPage extends ConsumerWidget {
|
||||
class MarketPage extends HookConsumerWidget {
|
||||
const MarketPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final market = ref.watch(marketControllerProvider);
|
||||
final exchange = ref.watch(exchangeCalculatorControllerProvider);
|
||||
final gramCtrl = useTextEditingController(text: exchange.gram.toStringAsFixed(2));
|
||||
final amountCtrl = useTextEditingController(text: exchange.amount.toStringAsFixed(2));
|
||||
final gramFocus = useFocusNode();
|
||||
final amountFocus = useFocusNode();
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
|
||||
useEffect(() {
|
||||
if (!gramFocus.hasFocus) {
|
||||
gramCtrl.text = exchange.gram.toStringAsFixed(
|
||||
exchange.gram % 1 == 0 ? 0 : 2,
|
||||
);
|
||||
}
|
||||
if (!amountFocus.hasFocus) {
|
||||
amountCtrl.text = exchange.amount.toStringAsFixed(2);
|
||||
}
|
||||
return null;
|
||||
}, [exchange.gram, exchange.amount, exchange.selectedChannel.id, exchange.metal.id]);
|
||||
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(18, 18, 18, 24),
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 86),
|
||||
children: [
|
||||
Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: Adaptive.contentMaxWidth,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
SegmentedButton<MetalType>(
|
||||
segments: [
|
||||
for (final metal in MetalType.values)
|
||||
ButtonSegment(value: metal, label: Text(metal.label)),
|
||||
],
|
||||
selected: {market.selectedMetal},
|
||||
onSelectionChanged: (next) {
|
||||
final metal = next.first;
|
||||
ref
|
||||
.read(marketControllerProvider.notifier)
|
||||
.selectMetal(metal);
|
||||
ref
|
||||
.read(exchangeCalculatorControllerProvider.notifier)
|
||||
.selectMetal(metal);
|
||||
PrototypeFrame(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Text(
|
||||
'行情',
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF7F4EE),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.notifications_none_outlined,
|
||||
size: 18,
|
||||
color: Color(0xFF9A968D),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: ListView.separated(
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: MetalType.values.length,
|
||||
separatorBuilder: (context, index) => 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: 12),
|
||||
_Card(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(market.quote.basisLabel, style: _mutedStyle(cs)),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'${formatCny(market.quote.spotPrice)} / 克',
|
||||
style: TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: cs.foreground,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
PrototypeCard(
|
||||
padding: const EdgeInsets.fromLTRB(14, 12, 14, 13),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'¥',
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: cs.foreground,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'${market.quote.changeAmount >= 0 ? '+' : ''}${market.quote.changeAmount.toStringAsFixed(2)} · ${market.quote.changePercent.toStringAsFixed(2)}%',
|
||||
style: TextStyle(
|
||||
color: market.quote.changeAmount >= 0
|
||||
? const Color(0xFFC0392B)
|
||||
: const Color(0xFF2E8B6F),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
formatCny(market.quote.spotPrice).replaceFirst('¥', ''),
|
||||
style: TextStyle(
|
||||
fontSize: 29,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: cs.foreground,
|
||||
letterSpacing: -1,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
children: [
|
||||
for (final period in MarketPeriod.values)
|
||||
ChoiceChip(
|
||||
label: Text(period.label),
|
||||
selected: period == market.period,
|
||||
onSelected: (_) => ref
|
||||
.read(marketControllerProvider.notifier)
|
||||
.selectPeriod(period),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 4, bottom: 2),
|
||||
child: Text(
|
||||
'元/克',
|
||||
style: TextStyle(fontSize: 12, color: Color(0xFF8A8780)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Row(
|
||||
children: [
|
||||
_ChangeChip(amount: market.quote.changeAmount, percent: market.quote.changePercent),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'报价 ${_timeLabel(market.quote.updatedAt)}',
|
||||
style: const TextStyle(fontSize: 12, color: Color(0xFF8A8780)),
|
||||
),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: const Icon(Icons.info_outline, size: 16, color: Color(0xFFB3AFA5)),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
for (final period in MarketPeriod.values) ...[
|
||||
_PeriodPill(
|
||||
label: period.label,
|
||||
selected: period == market.period,
|
||||
onTap: () => ref.read(marketControllerProvider.notifier).selectPeriod(period),
|
||||
),
|
||||
if (period != MarketPeriod.values.last) const SizedBox(width: 6),
|
||||
],
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
GestureDetector(
|
||||
onTap: () => context.push(
|
||||
'${AppRoutes.marketKline}?metal=${market.selectedMetal.id}&period=${market.period.id}',
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Text(
|
||||
'走势图 mock 点位:${market.points.length} 个',
|
||||
style: _mutedStyle(cs),
|
||||
child: SizedBox(
|
||||
height: 88,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: PrototypeLineChart(
|
||||
values: market.points.map((p) => p.close).toList(growable: false),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(height: 0.5, color: cs.border),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
const Text(
|
||||
'兑换试算',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const Spacer(),
|
||||
const PrototypePill(label: '多渠道参考', selected: true),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: ListView.separated(
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: exchange.channels.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(width: 7),
|
||||
itemBuilder: (context, index) {
|
||||
final channel = exchange.channels[index];
|
||||
return PrototypePill(
|
||||
label: channel.name,
|
||||
selected: channel.id == exchange.selectedChannel.id,
|
||||
onTap: () => ref
|
||||
.read(exchangeCalculatorControllerProvider.notifier)
|
||||
.selectChannel(channel.id),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (!exchange.swapped) ...[
|
||||
_ExchangeField(
|
||||
controller: gramCtrl,
|
||||
focusNode: gramFocus,
|
||||
unit: exchange.metal.label,
|
||||
leading: '克',
|
||||
onChanged: (value) {
|
||||
final gram = double.tryParse(value) ?? 0;
|
||||
ref.read(exchangeCalculatorControllerProvider.notifier).setGram(gram);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () => ref.read(exchangeCalculatorControllerProvider.notifier).toggleSwapped(),
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: cs.border, width: 0.5),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color(0x1F281F0C),
|
||||
blurRadius: 7,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(Icons.swap_vert, size: 16, color: Color(0xFFB5862A)),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_ExchangeField(
|
||||
controller: amountCtrl,
|
||||
focusNode: amountFocus,
|
||||
unit: 'CNY',
|
||||
leading: '¥',
|
||||
onChanged: (value) {
|
||||
final amount = double.tryParse(value) ?? 0;
|
||||
ref.read(exchangeCalculatorControllerProvider.notifier).setAmount(amount);
|
||||
},
|
||||
),
|
||||
] else ...[
|
||||
_ExchangeField(
|
||||
controller: amountCtrl,
|
||||
focusNode: amountFocus,
|
||||
unit: 'CNY',
|
||||
leading: '¥',
|
||||
onChanged: (value) {
|
||||
final amount = double.tryParse(value) ?? 0;
|
||||
ref.read(exchangeCalculatorControllerProvider.notifier).setAmount(amount);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Center(
|
||||
child: GestureDetector(
|
||||
onTap: () => ref.read(exchangeCalculatorControllerProvider.notifier).toggleSwapped(),
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: cs.border, width: 0.5),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Color(0x1F281F0C),
|
||||
blurRadius: 7,
|
||||
offset: Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(Icons.swap_vert, size: 16, color: Color(0xFFB5862A)),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_ExchangeField(
|
||||
controller: gramCtrl,
|
||||
focusNode: gramFocus,
|
||||
unit: exchange.metal.label,
|
||||
leading: '克',
|
||||
onChanged: (value) {
|
||||
final gram = double.tryParse(value) ?? 0;
|
||||
ref.read(exchangeCalculatorControllerProvider.notifier).setGram(gram);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'1 克 ${exchange.metal.label} = ${formatCny(exchange.selectedChannel.pricePerGram)} · ${exchange.selectedChannel.source} · 参考',
|
||||
style: const TextStyle(fontSize: 12, color: Color(0xFF6E6A60)),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
exchange.selectedChannel.hint,
|
||||
style: const TextStyle(fontSize: 11, color: Color(0xFFB3AFA5), height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_Card(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'兑换试算',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: cs.foreground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'${formatGram(exchange.gram)} ${exchange.metal.label} = ${formatCny(exchange.amount)}',
|
||||
style: TextStyle(fontSize: 20, color: cs.foreground),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'1 克 ${exchange.metal.label} = ${formatCny(exchange.selectedChannel.pricePerGram)} · ${exchange.selectedChannel.source}',
|
||||
style: _mutedStyle(cs),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
for (final channel in exchange.channels)
|
||||
ChoiceChip(
|
||||
label: Text(channel.name),
|
||||
selected:
|
||||
channel.id == exchange.selectedChannel.id,
|
||||
onSelected: (_) => ref
|
||||
.read(
|
||||
exchangeCalculatorControllerProvider
|
||||
.notifier,
|
||||
)
|
||||
.selectChannel(channel.id),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
exchange.selectedChannel.hint,
|
||||
style: _mutedStyle(cs),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -152,25 +317,100 @@ class MarketPage extends ConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _Card extends StatelessWidget {
|
||||
const _Card({required this.child});
|
||||
class _ExchangeField extends StatelessWidget {
|
||||
const _ExchangeField({
|
||||
required this.controller,
|
||||
required this.focusNode,
|
||||
required this.unit,
|
||||
required this.leading,
|
||||
required this.onChanged,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final TextEditingController controller;
|
||||
final FocusNode focusNode;
|
||||
final String unit;
|
||||
final String leading;
|
||||
final ValueChanged<String> onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
return DecoratedBox(
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 9),
|
||||
decoration: BoxDecoration(
|
||||
color: cs.card,
|
||||
border: Border.all(color: cs.border),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(13),
|
||||
border: Border.all(color: const Color(0xFFE3D6B4), width: 0.5),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(leading, style: const TextStyle(fontSize: 14, color: Color(0xFF8A8780))),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
keyboardType: const TextInputType.numberWithOptions(decimal: true),
|
||||
textAlign: TextAlign.right,
|
||||
decoration: const InputDecoration(
|
||||
border: InputBorder.none,
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
style: const TextStyle(fontSize: 21, fontWeight: FontWeight.w600),
|
||||
onChanged: onChanged,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
unit,
|
||||
style: const TextStyle(fontSize: 14, color: Color(0xFF8A8780)),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(padding: const EdgeInsets.all(16), child: child),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
TextStyle _mutedStyle(ShadColorScheme cs) {
|
||||
return TextStyle(fontSize: 13, color: cs.mutedForeground, letterSpacing: 0);
|
||||
class _PeriodPill extends StatelessWidget {
|
||||
const _PeriodPill({required this.label, required this.selected, required this.onTap});
|
||||
|
||||
final String label;
|
||||
final bool selected;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PrototypePill(label: label, selected: selected, onTap: onTap);
|
||||
}
|
||||
}
|
||||
|
||||
class _ChangeChip extends StatelessWidget {
|
||||
const _ChangeChip({required this.amount, required this.percent});
|
||||
|
||||
final double amount;
|
||||
final double percent;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final positive = amount >= 0;
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: positive ? const Color(0xFFFBEDEA) : const Color(0xFFE7F2EE),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: Text(
|
||||
'${positive ? '↑' : '↓'}¥${amount.abs().toStringAsFixed(2)} · ${positive ? '+' : '-'}${percent.abs().toStringAsFixed(2)}%',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: positive ? const Color(0xFFC0392B) : const Color(0xFF2E8B6F),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _timeLabel(DateTime value) {
|
||||
return '${value.hour.toString().padLeft(2, '0')}:${value.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../../common/widgets/prototype_ui.dart';
|
||||
import '../application/news_controller.dart';
|
||||
|
||||
class NewsDetailPage extends ConsumerWidget {
|
||||
const NewsDetailPage({super.key, this.id});
|
||||
|
||||
final String? id;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final news = ref.watch(newsControllerProvider).items;
|
||||
final item = news.firstWhere(
|
||||
(item) => id == null || item.id == id,
|
||||
orElse: () => news.first,
|
||||
);
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFFBFAF7),
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFFFBFAF7),
|
||||
surfaceTintColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
centerTitle: true,
|
||||
leading: IconButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
icon: const Icon(Icons.chevron_left, size: 20),
|
||||
),
|
||||
title: Text(
|
||||
item.metal.label,
|
||||
style: const TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 24),
|
||||
children: [
|
||||
PrototypeFrame(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
PrototypeCard(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: item.metal.color.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: Text(
|
||||
item.metal.label,
|
||||
style: TextStyle(
|
||||
color: item.metal.color,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'${item.source} · ${_timeLabel(item.publishedAt)}',
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
item.title,
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w700, height: 1.4),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
for (final paragraph in item.body) ...[
|
||||
Text(
|
||||
paragraph,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
height: 1.7,
|
||||
color: cs.foreground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
],
|
||||
Text(
|
||||
'本资讯为原型示意内容,信息整理 · 非投资建议。',
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground, height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _timeLabel(DateTime value) {
|
||||
return '${value.hour.toString().padLeft(2, '0')}:${value.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
|
||||
import '../../../common/widgets/adaptive.dart';
|
||||
import '../../../common/router/app_router.dart';
|
||||
import '../../../common/widgets/prototype_ui.dart';
|
||||
import '../application/news_controller.dart';
|
||||
|
||||
class NewsPage extends ConsumerWidget {
|
||||
@@ -15,104 +17,91 @@ class NewsPage extends ConsumerWidget {
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(18, 18, 18, 24),
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 86),
|
||||
children: [
|
||||
Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: Adaptive.contentMaxWidth,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'信息整理 · 非投资建议',
|
||||
style: TextStyle(
|
||||
color: cs.mutedForeground,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
ref.read(newsControllerProvider.notifier).refresh(),
|
||||
child: const Text('刷新'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
for (final item in news.items)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: cs.card,
|
||||
border: Border.all(color: cs.border),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: item.metal.color.withValues(
|
||||
alpha: 0.12,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: Text(
|
||||
item.metal.shortLabel,
|
||||
style: TextStyle(
|
||||
color: item.metal.color,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'${item.source} · ${item.publishedAt.hour.toString().padLeft(2, '0')}:${item.publishedAt.minute.toString().padLeft(2, '0')}',
|
||||
style: TextStyle(
|
||||
color: cs.mutedForeground,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
item.title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: cs.foreground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
item.summary,
|
||||
style: TextStyle(
|
||||
color: cs.mutedForeground,
|
||||
height: 1.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
PrototypeFrame(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Text(
|
||||
'资讯',
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
onPressed: () => ref.read(newsControllerProvider.notifier).refresh(),
|
||||
icon: const Icon(Icons.refresh, size: 19),
|
||||
color: const Color(0xFF9A968D),
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: 30,
|
||||
height: 30,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
'信息整理 · 非投资建议',
|
||||
style: TextStyle(fontSize: 13, color: cs.mutedForeground),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
for (final item in news.items) ...[
|
||||
PrototypeCard(
|
||||
margin: const EdgeInsets.only(bottom: 10),
|
||||
child: InkWell(
|
||||
onTap: () => context.push('${AppRoutes.newsDetail}?id=${item.id}'),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: item.metal.color.withValues(alpha: 0.12),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
child: Text(
|
||||
item.metal.shortLabel,
|
||||
style: TextStyle(
|
||||
color: item.metal.color,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'${item.source} · ${_timeLabel(item.publishedAt)}',
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
|
||||
),
|
||||
const Spacer(),
|
||||
Icon(Icons.chevron_right, size: 16, color: cs.mutedForeground),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
item.title,
|
||||
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w700),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
item.summary,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: cs.mutedForeground,
|
||||
height: 1.55,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -120,3 +109,7 @@ class NewsPage extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _timeLabel(DateTime value) {
|
||||
return '${value.hour.toString().padLeft(2, '0')}:${value.minute.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
@@ -40,4 +40,13 @@ class ProfileSettingsController extends StateNotifier<ProfileSettings> {
|
||||
void setPriceColorMode(PriceColorMode mode) {
|
||||
state = state.copyWith(priceColorMode: mode);
|
||||
}
|
||||
|
||||
void setRecycleDiscount(MetalType metal, double value) {
|
||||
state = state.copyWith(
|
||||
recycleDiscounts: {
|
||||
...state.recycleDiscounts,
|
||||
metal: value.clamp(0.7, 1.0),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,12 +2,15 @@ import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
import '../../../common/config/app_h5_urls.dart';
|
||||
import '../../../common/router/app_router.dart';
|
||||
import '../../../common/widgets/adaptive.dart';
|
||||
import '../../../common/widgets/prototype_ui.dart';
|
||||
import '../../auth/application/auth_controller.dart';
|
||||
import '../../auth/data/auth_models.dart';
|
||||
import '../../profile/application/profile_settings_controller.dart';
|
||||
import '../application/profile_settings_controller.dart';
|
||||
import '../data/profile_models.dart';
|
||||
|
||||
class ProfilePage extends ConsumerWidget {
|
||||
const ProfilePage({super.key});
|
||||
@@ -25,161 +28,416 @@ class ProfilePage extends ConsumerWidget {
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(18, 18, 18, 24),
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 0, 86),
|
||||
children: [
|
||||
Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxWidth: Adaptive.contentMaxWidth,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_Card(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
currentUser?.nickname ?? '未登录',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: cs.foreground,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
currentUser?.phone ?? '登录后可使用本地同步、云备份占位和账户管理。',
|
||||
style: TextStyle(color: cs.mutedForeground),
|
||||
),
|
||||
],
|
||||
),
|
||||
PrototypeFrame(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const Text(
|
||||
'我的',
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
PrototypeCard(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 46,
|
||||
height: 46,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF1EFE9),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => context.push(AppRoutes.settings),
|
||||
child: const Text('设置'),
|
||||
child: const Icon(
|
||||
Icons.person_outline,
|
||||
color: Color(0xFF9A968D),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_Card(
|
||||
child: Column(
|
||||
children: [
|
||||
_SettingRow(
|
||||
label: '隐藏金额',
|
||||
value: settings.amountHidden ? '已隐藏' : '显示中',
|
||||
trailing: Switch(
|
||||
value: settings.amountHidden,
|
||||
onChanged: (_) => ref
|
||||
.read(
|
||||
profileSettingsControllerProvider.notifier,
|
||||
)
|
||||
.toggleAmountHidden(),
|
||||
),
|
||||
),
|
||||
_SettingRow(
|
||||
label: '回收折扣',
|
||||
value:
|
||||
'金 ${(settings.recycleDiscounts.values.first * 100).toStringAsFixed(0)}%',
|
||||
),
|
||||
_SettingRow(
|
||||
label: '涨跌颜色',
|
||||
value: settings.priceColorMode.label,
|
||||
),
|
||||
_SettingRow(
|
||||
label: '纯度系数',
|
||||
value: '${settings.purityPresets.length} 项',
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_Card(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
FilledButton.tonal(
|
||||
onPressed: loggedIn
|
||||
? () => context.push(AppRoutes.login)
|
||||
: () => context.push(AppRoutes.login),
|
||||
child: Text(loggedIn ? '切换账号' : '去登录'),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
OutlinedButton(
|
||||
onPressed: () => context.push(AppRoutes.settings),
|
||||
child: const Text('打开设置'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_Card(
|
||||
child: Text(
|
||||
'风险提示 · 数据来源 · 免责\n价格、资讯与估值均为本地 mock 数据,仅用于产品原型验证,不构成投资建议。',
|
||||
style: TextStyle(
|
||||
color: cs.mutedForeground,
|
||||
height: 1.6,
|
||||
fontSize: 13,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
currentUser?.nickname ?? '未登录',
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
currentUser?.phone ?? '登录后可云备份、多端同步',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: cs.mutedForeground,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (!loggedIn)
|
||||
FilledButton(
|
||||
onPressed: () => context.push(AppRoutes.login),
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
minimumSize: Size.zero,
|
||||
),
|
||||
child: Text('登录'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
_MenuRow(
|
||||
title: '邀请好友,各得奖励',
|
||||
subtitle: '需登录',
|
||||
icon: Icons.card_giftcard_outlined,
|
||||
backgroundColor: const Color(0xFFF6ECD6),
|
||||
iconColor: const Color(0xFFB5862A),
|
||||
onTap: () => _showInviteSheet(context),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_MenuRow(
|
||||
title: '分享我的贵金属估值卡',
|
||||
subtitle: '免登录 · 自动打码金额',
|
||||
icon: Icons.share_outlined,
|
||||
backgroundColor: const Color(0xFFEAF1FF),
|
||||
iconColor: const Color(0xFF4F7DD1),
|
||||
onTap: () =>
|
||||
_showShareCardSheet(context, currentUser?.nickname),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
_SettingRow(
|
||||
icon: Icons.download_outlined,
|
||||
title: '本地导出备份',
|
||||
trailing: '导出',
|
||||
onTap: () => _showLocalBackupSheet(context),
|
||||
backgroundColor: const Color(0xFFF3EFE7),
|
||||
iconColor: const Color(0xFF8A8780),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.cloud_outlined,
|
||||
title: '云备份 · 多端同步',
|
||||
trailing: loggedIn ? '已登录' : '登录解锁',
|
||||
onTap: () => _showCloudBackupSheet(context, loggedIn),
|
||||
backgroundColor: const Color(0xFFEAF2ED),
|
||||
iconColor: const Color(0xFF5E8E75),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
_SettingRow(
|
||||
icon: Icons.grid_view_outlined,
|
||||
title: '添加桌面小组件',
|
||||
trailing: '占位',
|
||||
onTap: () => _showWidgetSheet(context),
|
||||
backgroundColor: const Color(0xFFF6ECD6),
|
||||
iconColor: const Color(0xFFB5862A),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.tune_outlined,
|
||||
title: '纯度系数管理',
|
||||
trailing: '${settings.purityPresets.length} 项',
|
||||
onTap: () => _showPuritySheet(context, settings),
|
||||
backgroundColor: const Color(0xFFF4EAF8),
|
||||
iconColor: const Color(0xFF8A5CBF),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.percent_outlined,
|
||||
title: '回收折扣设置',
|
||||
trailing:
|
||||
'金 ${(settings.recycleDiscounts.values.first * 100).toStringAsFixed(0)}%',
|
||||
onTap: () => _showRecycleSheet(context, settings),
|
||||
backgroundColor: const Color(0xFFF8EFE0),
|
||||
iconColor: const Color(0xFFB07A32),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.palette_outlined,
|
||||
title: '涨跌颜色',
|
||||
trailing: settings.priceColorMode.label,
|
||||
onTap: () => _showPriceColorSheet(context, ref),
|
||||
backgroundColor: const Color(0xFFE9F3F1),
|
||||
iconColor: const Color(0xFF4E8B7B),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.currency_yen_outlined,
|
||||
title: '显示币种',
|
||||
trailing: '¥ CNY',
|
||||
onTap: () => _showCurrencySheet(context),
|
||||
backgroundColor: const Color(0xFFF1EFE9),
|
||||
iconColor: const Color(0xFF7F7A73),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
PrototypeCard(
|
||||
padding: EdgeInsets.zero,
|
||||
child: Column(
|
||||
children: [
|
||||
_SettingRow(
|
||||
icon: Icons.settings,
|
||||
title: '设置',
|
||||
trailing: null,
|
||||
onTap: () => context.push(AppRoutes.settings),
|
||||
backgroundColor: const Color(0xFFF1EFE9),
|
||||
iconColor: const Color(0xFF7F7A73),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.privacy_tip_outlined,
|
||||
title: '隐私政策 · 用户协议',
|
||||
trailing: null,
|
||||
onTap: () => launchUrlString(
|
||||
AppH5UrlsHelper.withCacheBuster(
|
||||
AppH5Urls.userProtocolUrl,
|
||||
),
|
||||
mode: LaunchMode.inAppBrowserView,
|
||||
),
|
||||
backgroundColor: const Color(0xFFF1EFE9),
|
||||
iconColor: const Color(0xFF7F7A73),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.info_outline,
|
||||
title: '免责声明 · 数据来源',
|
||||
trailing: null,
|
||||
onTap: () => _showDisclaimer(context),
|
||||
backgroundColor: const Color(0xFFF7F0E2),
|
||||
iconColor: const Color(0xFFB07A32),
|
||||
),
|
||||
const PrototypeDivider(margin: EdgeInsets.zero),
|
||||
_SettingRow(
|
||||
icon: Icons.feedback_outlined,
|
||||
title: '意见反馈 · 关于金值',
|
||||
trailing: null,
|
||||
onTap: () => _showAbout(context),
|
||||
backgroundColor: const Color(0xFFEAF1FF),
|
||||
iconColor: const Color(0xFF4F7DD1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
PrototypeCard(
|
||||
child: Text(
|
||||
'风险提示 · 数据来源 · 免责\n金值是贵金属资产记录与估值工具,所有信息不构成投资建议。\n· 行情 / 兑换价格均为参考,标注来源与更新时间,实际以交易系统 / 门店为准。\n· 材料价值 = 克重 × 纯度系数 × 上海金现货,非金店零售价(含工费 / 品牌溢价)、非回收实收价。\n· 资讯为信息整理,非投资建议;历史走势不代表未来。',
|
||||
style: TextStyle(
|
||||
color: cs.mutedForeground,
|
||||
height: 1.7,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _showDisclaimer(BuildContext context) {
|
||||
context.push(AppRoutes.profileDisclaimer);
|
||||
}
|
||||
|
||||
Future<void> _showInviteSheet(BuildContext context) async {
|
||||
context.push(AppRoutes.profileInvite);
|
||||
}
|
||||
|
||||
Future<void> _showShareCardSheet(
|
||||
BuildContext context,
|
||||
String? nickname,
|
||||
) async {
|
||||
context.push(AppRoutes.profileShare);
|
||||
}
|
||||
|
||||
Future<void> _showLocalBackupSheet(BuildContext context) async {
|
||||
context.push(AppRoutes.profileLocalBackup);
|
||||
}
|
||||
|
||||
Future<void> _showCloudBackupSheet(
|
||||
BuildContext context,
|
||||
bool loggedIn,
|
||||
) async {
|
||||
context.push(AppRoutes.profileCloudBackup);
|
||||
}
|
||||
|
||||
Future<void> _showWidgetSheet(BuildContext context) async {
|
||||
context.push(AppRoutes.profileWidget);
|
||||
}
|
||||
|
||||
Future<void> _showPriceColorSheet(BuildContext context, WidgetRef ref) async {
|
||||
context.push(AppRoutes.profilePriceColor);
|
||||
}
|
||||
|
||||
Future<void> _showPuritySheet(
|
||||
BuildContext context,
|
||||
ProfileSettings settings,
|
||||
) async {
|
||||
context.push(AppRoutes.profilePurity);
|
||||
}
|
||||
|
||||
Future<void> _showRecycleSheet(
|
||||
BuildContext context,
|
||||
ProfileSettings settings,
|
||||
) async {
|
||||
context.push(AppRoutes.profileRecycle);
|
||||
}
|
||||
|
||||
Future<void> _showCurrencySheet(BuildContext context) async {
|
||||
context.push(AppRoutes.profileCurrency);
|
||||
}
|
||||
|
||||
void _showAbout(BuildContext context) {
|
||||
context.push(AppRoutes.profileAbout);
|
||||
}
|
||||
}
|
||||
|
||||
class _MenuRow extends StatelessWidget {
|
||||
const _MenuRow({
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.icon,
|
||||
required this.backgroundColor,
|
||||
required this.iconColor,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final IconData icon;
|
||||
final Color backgroundColor;
|
||||
final Color iconColor;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 34,
|
||||
height: 34,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(icon, size: 18, color: iconColor),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
subtitle,
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
Icon(Icons.chevron_right, size: 16, color: cs.mutedForeground),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _SettingRow extends StatelessWidget {
|
||||
const _SettingRow({required this.label, required this.value, this.trailing});
|
||||
const _SettingRow({
|
||||
required this.icon,
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
required this.backgroundColor,
|
||||
required this.iconColor,
|
||||
this.trailing,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final String value;
|
||||
final Widget? trailing;
|
||||
final IconData icon;
|
||||
final String title;
|
||||
final String? trailing;
|
||||
final VoidCallback onTap;
|
||||
final Color backgroundColor;
|
||||
final Color iconColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(fontSize: 15, color: cs.foreground),
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 34,
|
||||
height: 34,
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(icon, size: 18, color: iconColor),
|
||||
),
|
||||
),
|
||||
Text(value, style: TextStyle(color: cs.mutedForeground)),
|
||||
if (trailing != null) ...[const SizedBox(width: 8), trailing!],
|
||||
],
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (trailing != null)
|
||||
Text(
|
||||
trailing!,
|
||||
style: TextStyle(fontSize: 12, color: cs.mutedForeground),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Icon(Icons.chevron_right, size: 16, color: cs.mutedForeground),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _Card extends StatelessWidget {
|
||||
const _Card({required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cs = ShadTheme.of(context).colorScheme;
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: cs.card,
|
||||
border: Border.all(color: cs.border),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Padding(padding: const EdgeInsets.all(16), child: child),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user