readAtsign method

Future<AtsignKey?> readAtsign({
  1. required String name,
})

Function to get atsign's key with name

Implementation

Future<AtsignKey?> readAtsign({required String name}) async {
  final atSigns = await readAtsigns();
  if (atSigns.isEmpty) {
    return null;
  }
  for (int i = 0; i < atSigns.length; i++) {
    if (atSigns[i].atSign == name) {
      return atSigns[i];
    }
  }
  return null;
}