feat: Enhance shift filtering logic and update header text style for improved UI
This commit is contained in:
@@ -63,7 +63,15 @@ class HomeRepositoryImpl implements HomeRepository {
|
||||
final response = await ExampleConnector.instance.listShifts().execute();
|
||||
|
||||
return response.data.shifts
|
||||
.where((s) => s.status is Known && (s.status as Known).value == ShiftStatus.OPEN)
|
||||
.where((s) {
|
||||
final isOpen = s.status is Known && (s.status as Known).value == ShiftStatus.OPEN;
|
||||
if (!isOpen) return false;
|
||||
|
||||
final start = s.startTime?.toDate();
|
||||
if (start == null) return false;
|
||||
|
||||
return start.isAfter(DateTime.now());
|
||||
})
|
||||
.take(10)
|
||||
.map((s) => _mapConnectorShiftToDomain(s))
|
||||
.toList();
|
||||
|
||||
@@ -53,9 +53,7 @@ class HomeHeader extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
headerI18n.welcome_back,
|
||||
style: UiTypography.body3r.copyWith(
|
||||
color: UiColors.mutedForeground,
|
||||
),
|
||||
style: UiTypography.body3r.textSecondary,
|
||||
),
|
||||
Text(nameToDisplay, style: UiTypography.headline4m),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user