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;
}
}