Updates SectionHeader text styles, border, and radius, and reduces vertical spacing in WorkerHomePage.

This commit is contained in:
Achintha Isuru
2026-02-23 13:39:26 -05:00
parent 0ff2268959
commit 659b5812b0
2 changed files with 17 additions and 20 deletions

View File

@@ -154,7 +154,7 @@ class WorkerHomePage extends StatelessWidget {
);
},
),
const SizedBox(height: UiConstants.space6),
const SizedBox(height: UiConstants.space3),
// Tomorrow's Shifts
BlocBuilder<HomeCubit, HomeState>(
@@ -182,7 +182,7 @@ class WorkerHomePage extends StatelessWidget {
);
},
),
const SizedBox(height: UiConstants.space6),
const SizedBox(height: UiConstants.space3),
// Recommended Shifts
SectionHeader(title: sectionsI18n.recommended_for_you),

View File

@@ -1,19 +1,25 @@
import 'package:flutter/material.dart';
import 'package:design_system/design_system.dart';
/// Section header widget for home page sections, using design system tokens.
class SectionHeader extends StatelessWidget {
/// Section title
final String title;
/// Optional action label
final String? action;
/// Optional action callback
final VoidCallback? onAction;
/// Creates a [SectionHeader].
const SectionHeader({super.key, required this.title, this.action, this.onAction});
const SectionHeader({
super.key,
required this.title,
this.action,
this.onAction,
});
@override
Widget build(BuildContext context) {
@@ -27,19 +33,13 @@ class SectionHeader extends StatelessWidget {
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: UiTypography.body2m.textPrimary,
),
Text(title, style: UiTypography.body1b),
if (onAction != null)
GestureDetector(
onTap: onAction,
child: Row(
children: [
Text(
action ?? '',
style: UiTypography.body3r.textPrimary,
),
Text(action ?? '', style: UiTypography.body3r),
const Icon(
UiIcons.chevronRight,
size: UiConstants.space4,
@@ -56,23 +56,20 @@ class SectionHeader extends StatelessWidget {
),
decoration: BoxDecoration(
color: UiColors.primary.withValues(alpha: 0.08),
borderRadius:
BorderRadius.circular(UiConstants.radiusBase),
borderRadius: UiConstants.radiusMd,
border: Border.all(
color: UiColors.primary.withValues(alpha: 0.2),
color: UiColors.primary,
width: 0.5,
),
),
child: Text(
action!,
style: UiTypography.body3r.textPrimary,
style: UiTypography.body3r.primary,
),
),
],
)
: Text(
title,
style: UiTypography.body2m.textPrimary,
),
: Text(title, style: UiTypography.body1b),
),
],
),