flutter_data_json_api_adapter 0.3.0
flutter_data_json_api_adapter: ^0.3.0 copied to clipboard

JSON:API adapter for Flutter Data

flutter_data_json_api_adapter #

JSON:API adapter for Flutter Data.

👩🏾‍💻 Usage #

Add flutter_data_json_api_adapter to your pubspec.yaml and then import the adapter into your models.


@DataRepository([JSONAPIAdapter, MyJSONAPIAdapter])
class User with DataModel<User> {
  final int id;
  final String name;
  User({this.id, this.name});

mixin MyJSONAPIAdapter on RemoteAdapter<User> {
  String get baseUrl => "https://my.jsonapi.server/api";

  // other customizations

This adapter provides default application/vnd.api+json headers.

Tests can be run with: pub run test

📝 License #