feather_client_flutter 0.0.1 feather_client_flutter: ^0.0.1 copied to clipboard
This library provides an interface to the Feather API for applications running in Flutter.
Feather Client Flutter Plugin #
A Flutter plugin to use the Feather API.
Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!
Have any questions? We're hanging out on Discord 👋
Available Features #
Feature | Status |
---|---|
Create a credential (Email and password) | ✅ |
Create a credential (Email verification - passwordless -) | ⚙️ |
Update a credential | ⚙️ |
Update a credential password | ⚙️ |
Creates a user | ✅ |
Retrieve a user | ⚙️ |
Update a user | ⚙️ |
Update a user's email | ⚙️ |
Refresh a user's tokens | ⚙️ |
Revoke a user's tokens | ⚙️ |
- ✅ Done
- ⚙️ Under development
Getting Started #
dependencies:
...
feather_client_flutter:
Usage example #
The Feather package must be initialized with your project's API key, available on the Feather Dashboard. Include the API key when you use the plugin.
Add the following imports to your Dart code:
import 'package:feather_client_flutter/feather_client_flutter.dart';
Initialize FeatherClient
:
Final FeatherClient featherClient = FeatherClient(apiKey: "YOUR_API_KEY");
To sign in:
featherClient
.newCurrentCredential(email: "test5@test.com", password: "password")
.then((credential) {
if (credential.status == "valid") {
featherClient.newCurrentUser(token: credential.token).then((featherUser) {
print("User id : ${featherUser.id}");
}).catchError((error) {
// Handle errors
print(error.toString());
}
}
);
}).catchError((error) {
// Handle errors
print(error.toString());
});
Error handling #
If a method fails it will throw a FeatherException
with the error code as a string.
So make sure to wrap your calls with a try..catch
or add a .catchError
functions.
Check the source comments to see which error codes each method could throw.
Supported authentication methods #
- Email and Password
- Anonymously (To be added later)