https://github.com/kinetsystems/frappe_dart
A comprehensive Dart wrapper for interacting with the Frappe API, providing easy access to its features and enabling seamless communication with Frappe-based systems.
https://github.com/kinetsystems/frappe_dart
api dart erpnext flutter frappe rest-api
Last synced: 4 months ago
JSON representation
A comprehensive Dart wrapper for interacting with the Frappe API, providing easy access to its features and enabling seamless communication with Frappe-based systems.
- Host: GitHub
- URL: https://github.com/kinetsystems/frappe_dart
- Owner: kinetsystems
- License: mit
- Created: 2024-12-19T06:39:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-26T08:36:31.000Z (9 months ago)
- Last Synced: 2026-02-19T08:10:27.087Z (4 months ago)
- Topics: api, dart, erpnext, flutter, frappe, rest-api
- Language: Dart
- Homepage: https://pub.dev/packages/frappe_dart
- Size: 210 KB
- Stars: 15
- Watchers: 1
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Frappe Dart
A comprehensive Dart wrapper for interacting with the Frappe API, providing easy access to its features and enabling seamless communication with Frappe-based systems.
🚧 **Note:** This project is currently under construction and is not production-ready. Expect significant changes as the project evolves.
## Example App
Looking for a working example? Check out the official example app here:
👉 [https://github.com/kinetsystems/frappify](https://github.com/kinetsystems/frappify)
This separate repository demonstrates how to integrate and use `frappe_dart` in a real-world Flutter application.
## Installation
To get started with the `frappe_dart` package, add it to your project's `pubspec.yaml` dependencies:
```yaml
dependencies:
frappe_dart: ^0.0.6
```
## Usage
Once installed, you can use the wrapper to interact with the Frappe API. Here's an example of how to perform a basic request:
```dart
import 'package:frappe_dart/frappe_dart.dart';
void main() async {
final frappeClient = FrappeV15(
baseUrl: 'https://your-frappe-url.com',
);
try {
final authResponse = await frappeClient.login(
LoginRequest(
usr: 'your-username',
pwd: 'your-password',
),
);
frappeClient.cookie = authResponse.cookie;
final sidebarItems = await frappeClient.getDeskSideBarItems();
final page = sidebarItems.message!.pages!
.firstWhere((element) => element.name == 'Users');
final deskPage = await frappeClient.getDesktopPage(
DesktopPageRequest(
name: page.name,
),
);
print(deskPage.toJson());
} catch (error) {
print('Error: $error');
}
}
```
## How to extend
You can extend the functionality of frappe_dart to support additional custom API endpoints using Dart's extension methods.
```dart
import 'package:http/http.dart' as http;
extension FrappeV15Extensions on FrappeV15 {
Future> newApiEndPoint() async {
final url = '$baseUrl/api/method/new_api_endpoint';
final response = await dio.get>(
url,
headers: {
if (cookie != null) 'Cookie': cookie,
},
);
return response.data!;
}
}
```
## Contributing
We welcome contributions to improve and extend the functionality of frappe_dart. If you’d like to contribute, please follow these steps:
1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Write tests to ensure the changes work as expected.
4. Submit a pull request with a detailed explanation of your changes.
For bug reports, feature requests, or any issues, please open an issue on the GitHub repository.
## License
This project is licensed under the MIT License - see the LICENSE file for details.