searchData method

Future<Map?> searchData({
  1. required String from,
  2. required String column,
  3. required String query,
  4. List<String>? columns,
  5. SupabaseClient? supabaseClient,
})

get data

Implementation

Future<Map?> searchData({
  required String from,
  required String column,
  required String query,
  List<String>? columns,
  SupabaseClient? supabaseClient,
}) async {
  var response = await client(supabaseClient: supabaseClient).from(from).select(parseColumns(columns)).textSearch(column, query);

  List<Map> data = (response).cast<Map>();
  if (data.isEmpty) {
    return null;
  }
  return data.first;
}