removeDatabaseModel function

Future<List<String>?> removeDatabaseModel(
  1. Map<String, dynamic> context
)

This function runs in an isolated thread. Please use Database.removeModel

Implementation

Future<List<String>?> removeDatabaseModel(Map<String, dynamic> context) async {
  try {
    List<Map<String, dynamic>> models = context['models'];

    List<String> data = [];

    for (int i = 0; i < models.length; i++) {
      if (models[i]['id'] != context['id']) {
        data.add(jsonEncode(models[i]));
      }
    }

    return data;
  } catch (e) {
    print(e);
  }

  return null;
}