Files

68 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import '../../../features/divination/data/models/divination_params.dart';
import '../../theme/design_tokens.dart';
import 'divination_terms.dart';
import 'yao_glyph.dart';
class YaoLineRow extends StatelessWidget {
const YaoLineRow({
super.key,
required this.name,
required this.type,
this.showChangeMark = true,
this.showName = true,
this.onTap,
this.enabled = true,
this.lineHeight = 6,
});
final String name;
final YaoType type;
final bool showChangeMark;
final bool showName;
final VoidCallback? onTap;
final bool enabled;
final double lineHeight;
@override
Widget build(BuildContext context) {
final mark = showChangeMark ? _changeMark(type) : '';
return InkWell(
onTap: enabled ? onTap : null,
borderRadius: BorderRadius.circular(AppRadius.sm),
child: SizedBox(
height: 38,
child: Row(
children: [
SizedBox(
width: 48,
child: Text(showName ? name : '', textAlign: TextAlign.center),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: YaoGlyph(type: type, height: lineHeight),
),
SizedBox(
width: 20,
child: Text(
mark,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w700,
color: Theme.of(context).colorScheme.primary,
),
),
),
],
),
),
);
}
String _changeMark(YaoType type) {
return type.changeMark;
}
}