getById method

  1. @override
Future<T?> getById(
  1. Id id
)
override

Implementation

@override
Future<T?> getById(Id id) async {
  try {
    final row = await config.tablesDB.getRow(
      databaseId: config.databaseId,
      tableId: config.tableId,
      rowId: config.idToString(id),
    );
    final data = Map<String, dynamic>.from(row.data);
    return config.fromJson(data);
  } on aw.AppwriteException {
    // Not found or other error
    return null;
  }
}