Add focus element to event cards

This commit is contained in:
Shawn 2024-02-05 14:30:43 -07:00
parent 4bb389cec2
commit 9f3c38d1b5

View File

@ -10,7 +10,8 @@ class TimelineEventCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MergeSemantics( return Focus(
child: MergeSemantics(
child: Padding( child: Padding(
padding: EdgeInsets.only(bottom: $styles.insets.sm), padding: EdgeInsets.only(bottom: $styles.insets.sm),
child: DefaultTextColor( child: DefaultTextColor(
@ -27,7 +28,8 @@ class TimelineEventCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('${year.abs()}', style: $styles.text.h3.copyWith(fontWeight: FontWeight.w400, height: 1)), Text('${year.abs()}',
style: $styles.text.h3.copyWith(fontWeight: FontWeight.w400, height: 1)),
Text(StringUtils.getYrSuffix(year), style: $styles.text.bodySmall), Text(StringUtils.getYrSuffix(year), style: $styles.text.bodySmall),
], ],
), ),
@ -40,7 +42,7 @@ class TimelineEventCard extends StatelessWidget {
/// Text content /// Text content
Expanded( Expanded(
child: Focus(child: Text(text, style: $styles.text.body)), child: Text(text, style: $styles.text.body),
), ),
], ],
), ),
@ -48,6 +50,7 @@ class TimelineEventCard extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
} }