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();
|
final response = await ExampleConnector.instance.listShifts().execute();
|
||||||
|
|
||||||
return response.data.shifts
|
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)
|
.take(10)
|
||||||
.map((s) => _mapConnectorShiftToDomain(s))
|
.map((s) => _mapConnectorShiftToDomain(s))
|
||||||
.toList();
|
.toList();
|
||||||
|
|||||||
@@ -53,9 +53,7 @@ class HomeHeader extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
headerI18n.welcome_back,
|
headerI18n.welcome_back,
|
||||||
style: UiTypography.body3r.copyWith(
|
style: UiTypography.body3r.textSecondary,
|
||||||
color: UiColors.mutedForeground,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(nameToDisplay, style: UiTypography.headline4m),
|
Text(nameToDisplay, style: UiTypography.headline4m),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user