The BeetleHR SDK Flutter
The BeetleHR SDK Flutter is a powerful software development kit that allows developers to integrate BeetleHR functionality into their Flutter applications. BeetleHR is a human resources management platform that provides various features related to employee management, such as attendance tracking, leave management, and employee performance evaluation. This documentation will guide you through the process of integrating and utilizing the BeetleHR SDK in your Flutter projects.
Features
Here are all the features available on our sdk, take advantage and make your development easier with us.
Server
xfeature to retrieve server status from an endpoint
Authentication Employee
xlogin with email and passwordxreset password with email
Profile Employee
xget profile employeexupdate profile
Attendance Employee
xget attendence overviewxupload attendence imagexget attendence logsxcheck branch officexget attendance detailxcheck accept clockxclock attendencexget schedulexcheck accept clock attendancexget schedule logxget clock button typexsync attendancexupload attendance imagexcancel attendancexbreak timexcheck breaktime setting
Notice Employee
xRetrieves the notice board dataxRetrieves all approval requests based on the specified parametersxRetrieves the approval request detailxApproves a request with the providedbodyandidxRejects a request and returns the responsexRetrieves notification data and returns the responsexRetrieves the details of a notification based on itsidxRetrieves employee data based on name filtering parameters
Payroll Employee
xRetrieves a list of payrollsxRetrieves the details of a payrollxRetrieves a list of THR (holiday allowance) payrollsxRetrieves the details of a THR (holiday allowance) payroll
Beetlehr SDK Versions
Note: Updated to new sdk with new features.
Documentation
Get Started
Add dependency
You can add beetlehr_sdk in your pubspec.yaml or use the command to add beetlerhr_sdk as a dependency with the latest stable version:
flutter pub add beetlehr_sdk
If you want to use it directly from github you can add it in pubspec.yaml as follows:
dependencies:
flutter:
sdk: flutter
beetlehr_sdk:
git:
url: https://github.com/kodingworks/beetlehr_sdk.git
ref: master # branch name
Initialisasi Client
Before using the function on the sdk, make sure you initialize the client. You can use Dependency Injection (DI) like get_it. so you don't have to always initialize your Client. here's an example of initialization that you can try:
BeetleHRClient client = BeetleHRClient(
'https://demo.beetlehr.com/api/v1',
isLog: true,
);
Usage Simple
Here is an example of using login authentication with email and password, you don't need to save the token because this package already helps save it. but we still return the token from the login result so you can use it for other purposes. here's an example:
void login() async {
try {
final client = BeetleHRClient(
'https://demo.beetlehr.com/api/v1',
isLog: true,
);
final result = await client.loginWithEmail(
email: 'email@email.com',
password: 'password',
);
print(result.meta); // return MetaData
print(result.token); // return String
print(result.user); // return UserModel
} catch (e) {
print('Something wrong!');
}
}
Error Handling
| Name | Item |
|---|---|
| Exception | ServerException |
| GeneralServerException | |
| TimeOutServerException | |
| NotFoundServerException | |
| UnAuthenticationServerException | |
| UnAuthorizeServerException | |
| InternalServerException | |
| Failure | CodeFailure |
| ServerFailure |
Community & Group Discussion
You could join us at Telegram Group https://t.me/+Fbaf_eCVHEg4NTY1
Contributing
We are very glad if you want to contribute and join our community. Please take note when you make a pull request. You must be very clear when making a commit message. When you contribute code, the best thing to do is imitate the existing pattern BeetleHR code.
License
Beetlehr SDK is released under the MIT license.