stringFromSearchFields function Null safety

List<String> stringFromSearchFields(
  1. List<GroupChannelListQuerySearchField> fields
)

Implementation

List<String> stringFromSearchFields(
    List<GroupChannelListQuerySearchField> fields) {
  if (fields.isEmpty) {
    return [];
  }

  final result = <String>[];
  fields.forEach((element) {
    if (element == GroupChannelListQuerySearchField.memberNickname) {
      result.add('member_nick_name');
    } else {
      result.add('channel_name');
    }
  });
  return result;
}