Files
kulakpos_web/walkthroughs/2026-04-14_ebbd4f55_Changes_Made.md
eko54r 05fd3230b8
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 5m14s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 17s
Build, Push and Deploy / deploy-staging (push) Successful in 41s
Build, Push and Deploy / deploy-production (push) Has been skipped
update marketing
2026-05-14 11:55:22 +07:00

27 lines
1.7 KiB
Markdown

## Changes Made
### Authentication & Global State
- **[auth_state.dart](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS%20PROJECT/Employee%20Portal%20Design/flutter-code/lib/auth_state.dart)**: Added `accessToken`, `id1`, `id2`, and `id3` as global variables and updated the `logout()` function to clear them.
- **[login_page.dart](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS%20PROJECT/Employee%20Portal%20Design/flutter-code/lib/pages/login/login_page.dart)**: Updated the login handler to capture these new credentials from the API response and store them in the global state.
### API Layer
- **[leave_api.dart](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS%20PROJECT/Employee%20Portal%20Design/flutter-code/lib/api/leave/leave_api.dart)**: Refactored `getDropdownBawahan` to use the globally stored `accessToken`, `id1`, `id2`, and `id3` as default values. This simplifies API calls from the UI layer as these parameters are now optional.
## Verification Results
### Static Analysis
Ran `flutter analyze` on the modified files. No errors were found; only minor styling/linting suggestions (like `avoid_print` and deprecated `withOpacity`) were noted, but they do not affect functionality.
### Manual Code Verification
Confirmed that [login_page.dart](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS%20PROJECT/Employee%20Portal%20Design/flutter-code/lib/pages/login/login_page.dart) correctly parses the response:
```dart
accessToken = result['data']?['access_token'];
id1 = result['data']?['id1']?.toString();
// ... etc
```
And [leave_api.dart](file:///home/itc43/Documents/HOKBEN_PROJECT/ESS%20PROJECT/Employee%20Portal%20Design/flutter-code/lib/api/leave/leave_api.dart) correctly consumes them:
```dart
final String activeToken = token ?? accessToken ?? "";
// ... etc
```