flutter_feathersjs 4.1.1-dev copy "flutter_feathersjs: ^4.1.1-dev" to clipboard
flutter_feathersjs: ^4.1.1-dev copied to clipboard

Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.

🐦 flutter_feathersjs 🐦 #

GitHub Repo stars pub version GitHub last commit

FlutterFeathersJs Icon
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.


Join the community on Telegram #

Join us on Telegram

Simple to use #

1. Install it #

# Please see https://pub-web.flutter-io.cn/packages/flutter_feathersjs/install
flutter_feathersjs: ^lastest

2. Import it #

// Import it
import 'package:flutter_feathersjs/flutter_feathersjs.dart';

3. Initialize it as single instance #



    //your  api baseUrl
    const BASE_URL = "https://flutter-feathersjs.herokuapp.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();

4. Configure and use only socketio or rest client #


    // 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.

Documentation #

Check it out at: https://dahkenangnon.github.io/flutter_feathersjs.dart/

Support #

Please email to dah.kenangnon (at) gmail (dot) com if you have any questions or comments or business support.

Contributing #

Please feel free to contribute to this project by opening an issue or creating a pull request.

14
likes
0
pub points
63%
popularity

Publisher

verified publisherdah-kenangnon.com

Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

dio, event_bus, flutter, flutter_secure_storage, socket_io_client

More

Packages that depend on flutter_feathersjs