🚀 *We're are working on the next release of this Project: 🎯 Version 5.0.0
👏 I use "We" becauase https://github.com/AurelAgbodoyetin joined me to maintain and make great again this package.
See our roadmap here: Dahkenangnon/flutter_feathersjs.dart#52
Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.
Infos: Feathers js is a node framework for real-time applications and REST APIs.
# Please see https://pub.dev/packages/flutter_feathersjs/install
flutter_feathersjs: ^lastest
// Import it
import 'package:flutter_feathersjs/flutter_feathersjs.dart';
//your api baseUrl
const BASE_URL = "https://your-feathersjs-server.com";
// Init it globally across your app, maybe with get_it or something like that
FlutterFeathersjs flutterFeathersjs = FlutterFeathersjs()..init(baseUrl: BASE_URL);
// Authenticate with email/password
var response = await flutterFeathersjs.authenticate(userName: user["email"], password: user["password"]);
print(response);
// ReAuthenticated with token
var response = await flutterFeathersjs.reAuthenticate();
print(response);
// Get authenticated user
var response = await flutterFeathersjs.user();
// Standalone socket io client
FlutterFeathersjs socketIOClient = FlutterFeathersjs();
// Socket.io client
IO.Socket io = IO.io(BASE_URL);
socketIOClient.configure(FlutterFeathersjs.socketioClient(io));
// Auth socketio client
var response = await socketIOClient.authenticate(userName: user["email"], password: user["password"]);
print(response);
// ReAuth socketio client
var reAuthResponse = await socketIOClient.reAuthenticate();
// Create a message using socketio standalone client
var ioResponse = await socketIOClient.service('messages').create({"text": 'A new message'});
// Get the authenticated user
var userResponse = await socketIOClient.user();
//StandAlone rest client
FlutterFeathersjs restClient = FlutterFeathersjs();
Dio dio = Dio(BaseOptions(baseUrl: BASE_URL));
restClient.configure(FlutterFeathersjs.restClient(dio));
// Authenticate user using rest client
var response = await restClient.authenticate( userName: user["email"], password: user["password"]);
print(response);
// Reauthenticate user using rest client
var reAuthResponse = await restClient.reAuthenticate();
// Call service
var restResponse = await restClient.service('messages').create({"text": 'A new message'});
// Get the authenticated user
var user = await restClient.user();
You're ready to go: 3, 2, 1 🚀 Checkout the doc for more info.
Check it out at: https://dahkenangnon.github.io/flutter_feathersjs.dart/
Please email to dah.kenangnon (at) gmail (dot) com if you have any questions or comments or business support.
Please feel free to contribute to this project by opening an issue or creating a pull request.