byId method

T? byId(
  1. int id
)

Implementation

T? byId(int id) {
  try {
    return list.firstWhere((f) => f.id == id);
  } catch (e) {
    return null;
  }
}