findByName method

Volume? findByName(
  1. String name
)

Finds and returns the volume with given name. Returns null if the volume doesn't exist.

Implementation

Volume? findByName(String name) {
  final list = volumes();

  for (final volume in list) {
    if (name == volume.name) {
      return volume;
    }
  }
  return null;
}