branchReference method

Future<BranchReference?> branchReference(
  1. String branchName
)

Implementation

Future<BranchReference?> branchReference(String branchName) async {
  final list = await branches();
  final matches = list.where((b) => b.branchName == branchName).toList();

  assert(matches.length <= 1);
  if (matches.isEmpty) {
    return null;
  } else {
    return matches.single;
  }
}