flutter_data_json_api_adapter 0.8.0 copy "flutter_data_json_api_adapter: ^0.8.0" to clipboard
flutter_data_json_api_adapter: ^0.8.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.

Example:

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

mixin MyJSONAPIAdapter on RemoteAdapter<User> {
  @override
  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 #

See LICENSE.

3
likes
130
points
105
downloads

Publisher

unverified uploader

Weekly Downloads

JSON:API adapter for Flutter Data

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, flutter_data, json_api

More

Packages that depend on flutter_data_json_api_adapter