FlutterFeathersjs class
FlutterFeatherJs
allow you to communicate with your feathers js server
If no error occured, you will get exactly feathersjs's data format
Otherwise, an exception of type FeatherJsError will be raised
Use FeatherJsErrorType.{ERROR} to known what happen
Uploading file ?: Use rest client, socketio client cannot upload file
Because we love the realtime side of feathers js, by default socketio's methods can be used on FlutterFeathersjs.{methodName}
Constructors
- FlutterFeathersjs()
-
factory
Properties
- client ↔ String
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- rest ↔ RestClient
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scketio ↔ SocketioClient
-
getter/setter pair
- standaloneRest ↔ FlutterFeathersjsRest?
-
getter/setter pair
- standaloneSocketio ↔ FlutterFeathersjsSocketio?
-
getter/setter pair
Methods
-
authenticate(
{String strategy = "local", required String? userName, required String? password, String userNameFieldName = "email"}) → Future< Map< String, dynamic> > - Authenticate rest and scketio clients so you can use both of them
-
configure(
dynamic client) → void - Configure a standalone client for feathers js
-
create(
{required String serviceName, required Map< String, dynamic> data, Map<String, dynamic> params = const {}}) → Future -
EMIT create serviceName
-
find(
{required String serviceName, required Map< String, dynamic> query}) → Future -
get(
{required String serviceName, required String objectId, Map< String, dynamic> params = const {}}) → Future -
EMIT get serviceName
-
init(
{required String baseUrl, Map< String, dynamic> ? extraHeaders}) → dynamic - Initialize both rest and scoketio client
-
listen<
T> (Function fromJson) → Stream< FeathersJsEventData< T> > -
Listen to On
` updated | patched | created | removed `
serviceName
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
{required String serviceName, required String objectId, required Map< String, dynamic> data, Map<String, dynamic> params = const {}}) → Future -
EMIT patch serviceName
-
reAuthenticate(
) → Future - ReAuthenticate rest and scketio clients
-
remove(
{required String serviceName, required String objectId, Map< String, dynamic> params = const {}}) → Future -
EMIT remove serviceName
-
service(
String serviceName) → dynamic - Prepare a client for rest or socketio call.
-
socketListen<
T> ({required String serviceName, required Function fromJson}) → Stream< FeathersJsEventData< T> > -
Listen to On
` updated | patched | created | removed `
serviceName
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{required String serviceName, required String objectId, required Map< String, dynamic> data, Map<String, dynamic> params = const {}}) → Future -
EMIT update serviceName
-
user(
) → Future - Return authenticated user from secure storage
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
restClient(
Dio dio) → dynamic - Get the standalone rest client
-
socketioClient(
Socket io) → dynamic - Get the standalone socketio client