fromStore static method

ContactViewModel fromStore(
  1. Store<CoreState> store
)

Implementation

static ContactViewModel fromStore(Store<CoreState> store) {
  final UserProfile profile = store.state.userState!.userProfile!;

  final EmailAddress primaryEmail =
      profile.primaryEmailAddress ?? EmailAddress.withValue(UNKNOWNEMAIL);

  final List<EmailAddress> secondaryEmailAddresses =
      profile.secondaryEmailAddresses ?? <EmailAddress>[];

  final List<PhoneNumber> secondaryPhoneNumbers =
      profile.secondaryPhoneNumbers ?? <PhoneNumber>[];

  return ContactViewModel(
    primaryPhone: profile.primaryPhoneNumber!,
    primaryEmail: primaryEmail,
    secondaryEmails: secondaryEmailAddresses,
    secondaryPhones: secondaryPhoneNumbers,
    wait: store.state.wait!,
  );
}