getListFiltrosComputed property

  1. @computed
List<FiltrosModel> get getListFiltrosComputed

Implementation

@computed
List<FiltrosModel> get getListFiltrosComputed {
  List<FiltrosModel> list = [];

  try {
    // Obtem o index da lista de filtros carregados sem alterar diretamente o observável
    int index = retornarIndexListaFiltrosCarregados();
    list = listaFiltrosCarregados[index].listaFiltros;
  } catch (e) {
    list = [];
  }

  if (list.isEmpty) {
    return list;
  } else {
    return list.where((element) =>_verificarElementoContemPesquisa(element, pesquisaItensDoFiltro)).toList();
  }
}