getById method

Item getById(
  1. int id
)

Implementation

Item getById(int id) =>
    items.firstWhere((element) => element.id == id, orElse: null);