Override findOne URL Adapter

In this example we override URLs to hit finder endpoints with snake case, and for save to always use HTTP PUT:

mixin URLAdapter<T extends DataModel<T>> on RemoteAdapter<T> {
  @override
  String urlForFindAll(Map<String, dynamic> params) => type.snakeCase;

  @override
  String urlForFindOne(id, Map<String, dynamic> params) =>
      '${type.snakeCase}/$id';

  @override
  DataRequestMethod methodForSave(id, Map<String, dynamic> params) {
    return DataRequestMethod.PUT;
  }
}

Need professional help with Flutter?

Describe your project in detail and include your e-mail and budget.