getLastActiveAt method
Implementation
Future<String> getLastActiveAt(String model, {String? channelId}) async {
String where = "client_user_id = ?";
var whereArgs = [userId];
if (channelId != null) {
where += " AND channel_id = ?";
whereArgs.add(channelId);
}
var modelSyncs = await db.query(
model,
columns: ["MAX(updated_at) as updated_at"],
where: where,
whereArgs: whereArgs,
limit: 1,
);
if (modelSyncs.isEmpty) {
return "";
}
return (modelSyncs[0]["updated_at"] as String?) ?? "";
}