getModel static method

Future<Map<String, dynamic>?> getModel(
  1. String table,
  2. String id
)

Implementation

static Future<Map<String, dynamic>?> getModel(String table, String id) async {
  try {
    List<Map<String, dynamic>>? models = await getModels(table);

    if (models == null) {
      return null;
    }

    return compute(getDatabaseModel, {
      'table': table,
      'id': id,
      'models': models,
    });
  } catch (e) {
    print(e);
  }

  return null;
}