updateQueryField method

void updateQueryField({
  1. required String group,
  2. required String field,
  3. required String value,
})

Update the field within the query group with the given value.

Implementation

void updateQueryField({
  required String group,
  required String field,
  required String value,
}) {
  final groupMap = FieldCodec.decodeQueryGroup(queryParams[group]);

  final newGroupMap = Map<String, String>.from(groupMap)
    ..update(
      field,
      (_) => value,
      ifAbsent: () => value,
    );

  updateQueryParam(
    group,
    FieldCodec.encodeQueryGroup(newGroupMap),
  );
}