update marketing
All checks were successful
All checks were successful
This commit is contained in:
26
walkthroughs/2026-04-14_ebbd4f55_Changes_Made.md
Normal file
26
walkthroughs/2026-04-14_ebbd4f55_Changes_Made.md
Normal file
@@ -0,0 +1,26 @@
|
||||
## 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
|
||||
```
|
||||
Reference in New Issue
Block a user