Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flutterando/uno
Future based HTTP client for the Dart and Flutter
https://github.com/flutterando/uno
dart flutter
Last synced: about 7 hours ago
JSON representation
Future based HTTP client for the Dart and Flutter
- Host: GitHub
- URL: https://github.com/flutterando/uno
- Owner: Flutterando
- License: mit
- Created: 2021-11-14T03:01:28.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-05T02:02:31.000Z (6 months ago)
- Last Synced: 2024-08-21T15:58:18.967Z (3 months ago)
- Topics: dart, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/uno
- Size: 1.13 MB
- Stars: 77
- Watchers: 8
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
UNO - Future based HTTP client for Dart and Flutter.
Uno, inspired by Axios, brings a simple and robust experience to crossplatform apps in Flutter and server apps in Dart.
Explore the docs »
Report Bug
·
Request Feature
[![License](https://img.shields.io/github/license/flutterando/uno?style=plastic)](https://github.com/Flutterando/uno/blob/master/LICENSE)
[![Pub Points](https://img.shields.io/pub/points/uno?label=pub%20points&style=plastic)](https://pub.dev/packages/uno/score)
[![Contributors](https://img.shields.io/github/contributors/flutterando/uno?style=plastic)](https://github.com/Flutterando/uno/graphs/contributors)
[![Forks](https://img.shields.io/github/forks/flutterando/uno?color=yellowgreen&logo=github&style=plastic)](https://github.com/Flutterando/asuka/graphs/contributors)[![Pub Publisher](https://img.shields.io/pub/publisher/uno?style=plastic)](https://pub.dev/publishers/flutterando.com.br/packages)
[![Flutterando Youtube](https://img.shields.io/youtube/channel/subscribers/UCplT2lzN6MHlVHHLt6so39A?color=blue&label=Flutterando&logo=YouTube&logoColor=red&style=plastic)](https://www.youtube.com/flutterando)
Table of Contents
## About The Project
Uno is a multiplatform HTTP client, based on Axios and built following the Clean Dart approach by the Flutterando Community.
It is a simple and hassle free solution while still bringing everything you need and a bit more in a HTTP client.## Sponsors
## Getting Started
To install Uno in your project you can follow the instructions below:
a) Add in your pubspec.yaml:
```sh
dependencies:
uno:
```
b) or use:
```sh
dart pub add uno
```## How To Use
Uno is ready for REST APIs. Methods like GET, POST, PUT, PATCH, DELETE are welcome here!
```Dart
final uno = Uno();// Make a request for a user with a given ID
uno.get('/users?id=1').then((response){
print(response.data); // it's a Map.
}).catchError((error){
print(error) // It's a UnoError.
});
```_For more examples, please refer to the_ [Documentation](https://pub.dev/documentation/uno/latest/)
## Features
- ✅ GET
- ✅ POST
- ✅ PATCH
- ✅ PUT
- ✅ DELETE
- ✅ Interceptors
- ✅ Error Handler
- ✅ Multipart/FormDataRight now this package has concluded all his intended features. If you have any suggestions or find something to report, see below how to contribute to it.
****
## Use cases**Send post json**
```Dart
final json = {
'name': 'Joshua',
'lastName': 'Baxter'
};await uno.post('/user', data: json);
```**Send post form urlencoded**
```Dart
final data = {
'name': 'Joshua',
'lastName': 'Baxter'
};await uno.post('/user', headers: {
HttpHeaders.contentTypeHeader: "application/x-www-form-urlencoded",
},
data: data,
);
```**Send Multipart form**
```Dart
final formData = FormData();
formData.add('name', 'Maira');
formData.add('lastName', 'Moura');await uno.post('/user', data: formData);
```**Upload file with multipart**
```Dart
final formData = FormData();
formData.addFile('file', 'image/profile.png');await uno.post('/upload', data: formData);
```**Download file**
```Dart
final response = await uno.get(
'file.csv',
responseType: ResponseType.arraybuffer,
onDownloadProgress: (total, current) {
print((current * total) / 100);
},
);
final bytes = response.data as List;
final file = File('localFile.csv');
await file.writeAsBytes(bytes);
```## Contributing
🚧 [Contributing Guidelines](https://github.com/angular/angular/blob/main/CONTRIBUTING.md) - Currently being updated 🚧
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the appropriate tag.
Don't forget to give the project a star! Thanks again!1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull RequestRemember to include a tag, and to follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and [Semantic Versioning](https://semver.org/) when uploading your commit and/or creating the issue.
## License
Distributed under the MIT License. See `LICENSE.txt` for more information.
## Contact
Flutterando Community
- [Discord](https://discord.gg/qNBDHNARja)
- [Telegram](https://t.me/flutterando)
- [Website](https://www.flutterando.com.br/)
- [Youtube Channel](https://www.youtube.com.br/flutterando)
- [Other useful links](https://linktr.ee/flutterando)## Aknowledgements
Thank you to all the people who contributed to this project, whithout you this project would not be here today.## Maintaned by
---
Built and maintained by Flutterando.