feat(divination): 重构手动起卦教程,支持三硬币交互选择
This commit is contained in:
@@ -175,6 +175,8 @@ class _DivinationResultScreenState extends State<DivinationResultScreen> {
|
||||
content: widget.data.conclusion,
|
||||
),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
_FocusPointsCard(points: widget.data.focusPoints),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
_AnalysisCard(
|
||||
title: l10n.resultAnalysis,
|
||||
content: widget.data.analysis,
|
||||
@@ -426,6 +428,71 @@ class _KeywordCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _FocusPointsCard extends StatelessWidget {
|
||||
const _FocusPointsCard({required this.points});
|
||||
|
||||
final List<String> points;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final languageCode = Localizations.localeOf(context).languageCode;
|
||||
final title = languageCode == 'en' ? 'Focus Points' : '断卦要点';
|
||||
if (points.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return Card(
|
||||
margin: EdgeInsets.zero,
|
||||
color: colors.surface,
|
||||
elevation: 2,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppRadius.md),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(AppSpacing.lg),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: colors.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
...List<Widget>.generate(points.length, (index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: AppSpacing.xs),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${index + 1}. ',
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: colors.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
points[index],
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodyMedium?.copyWith(height: 1.55),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _AnalysisCard extends StatelessWidget {
|
||||
const _AnalysisCard({required this.title, required this.content});
|
||||
|
||||
@@ -715,8 +782,11 @@ class _HexagramDetailCard extends StatelessWidget {
|
||||
for (int idx = 5; idx >= 0; idx--)
|
||||
_YaoDetailRow(
|
||||
line: data.yaoLines[idx],
|
||||
target: data.targetYaoLines[idx],
|
||||
showTarget: data.hasChangingYao,
|
||||
target: idx < data.targetYaoLines.length
|
||||
? data.targetYaoLines[idx]
|
||||
: data.yaoLines[idx],
|
||||
showTarget:
|
||||
data.hasChangingYao && idx < data.targetYaoLines.length,
|
||||
),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
const Align(
|
||||
|
||||
Reference in New Issue
Block a user