quickFilter method

dynamic quickFilter(
  1. dynamic sqlOrExp
)

Implementation

quickFilter(sqlOrExp) async {
   // Prevent multiple clicks
   if (isSearching==true) return;

   isSearching = true;

   // unique request id
   final currentRequestId = ++_searchRequestId;

   try {
     modelList?.clear();

     var instructions = sqlOrExp.split('#');

     var _whereFields = instructions[0];
     var queryValue = instructions[1];
     var sortType = instructions[2];

     quickWhere = queryValue.isEmpty
         ? ''
         : quickFilterWhereOr(_whereFields, queryValue);

     updateSql(0);

     await read(0, Libs.config.data.pageSize!);

     // Ignore outdated requests
     if (currentRequestId != _searchRequestId) {
       return;
     }
   } finally {
     isSearching = false;
   }
 }