Files
kulakpos_web/walkthroughs/2026-04-27_bb6330e6_Walkthrough__Dynamic_Team_Members_Count.md

20 lines
853 B
Markdown
Raw Permalink Normal View History

2026-05-14 11:55:22 +07:00
# Walkthrough - Dynamic Team Members Count
I have updated the Dashboard to dynamically display the total number of team members fetched from the Employee Directory API.
## Changes
### Dashboard
#### [dashboard_page.dart](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS%20PROJECT/Employee%20Portal%20Design/flutter-code/lib/pages/dashboard/dashboard_page.dart)
- Converted `DashboardPage` to a `StatefulWidget`.
- Added logic to fetch subordinate data using `DirectoryApi` during initialization.
- Replaced the hardcoded '24' with the actual count from the API.
- Added a loading state ('...') while data is being fetched.
## Verification Results
### Manual Verification
- The "Team Members" card on the dashboard now shows the count of employees retrieved from the backend API.
- If the API call fails or is loading, the UI handles it gracefully.