create method

Future<WriteResult> create(
  1. Map<String, dynamic> values
)

The relation-row writes (P9). Each goes through the relationship on the server (a child that is not this parent's is a 404, never a cross-parent write), returns the server's verdict as data — a 422 keyed by the CHILD resource's field names included, for the caller's form to render — and on success reloads through the list's own refresh: the write changed this page's membership, and re-fetching page one is the refresh the class already owns rather than a client-side row edit the server never confirmed.

Implementation

Future<WriteResult> create(Map<String, dynamic> values) async {
  final result = await _source.createRelation(
    resourceKey,
    id,
    relation,
    values,
  );
  if (result is WriteSuccess) await refresh();
  return result;
}