feat: 实现起卦、设置与积分系统
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../features/divination/data/models/divination_params.dart';
|
||||
import '../../theme/design_tokens.dart';
|
||||
|
||||
class YaoGlyph extends StatelessWidget {
|
||||
const YaoGlyph({super.key, required this.type, this.height = 6});
|
||||
|
||||
final YaoType type;
|
||||
final double height;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final lineColor = type == YaoType.undetermined
|
||||
? colors.outline
|
||||
: colors.primary;
|
||||
final isYin = type == YaoType.youngYin || type == YaoType.oldYin;
|
||||
if (!isYin) {
|
||||
return Container(
|
||||
key: const Key('yao_glyph_solid'),
|
||||
height: height,
|
||||
decoration: BoxDecoration(
|
||||
color: lineColor,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
key: const Key('yao_glyph_split_left'),
|
||||
height: height,
|
||||
decoration: BoxDecoration(
|
||||
color: lineColor,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
Expanded(
|
||||
child: Container(
|
||||
key: const Key('yao_glyph_split_right'),
|
||||
height: height,
|
||||
decoration: BoxDecoration(
|
||||
color: lineColor,
|
||||
borderRadius: BorderRadius.circular(height),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user