Feathers client for Dart
- Automatically stores access token to shared preference
- Re-authenticate app if access token expires
- Custom service
- Access to handle other outside api calls
dependencies:
feathers_auth_flutter: #latest version
import 'package:feathers_auth_flutter/feathers_auth_flutter.dart';
final FlutterFeathersApp app = FlutterFeathersApp('<base url>',
authConfig: AuthConfig('<authentication path>',
authMode: AuthMode.authenticateOnExpire,
sharedPrefKey: 'accessToken'));
app.initialize();
app.authenticate(body: {}, queryParameters: {});
app.reAuthenticate(AuthMode.authenticateOnExpire);
final FlutterFeatherService userService = app.service('users');
final usersRes = await userService.get<String>();
log('USER SERVICE GET ${usersRes.data}');
final res = await app.rawDio.get<String>('<any outside urls>');
log('RAW GET ${res.data}');