AccountModel.cloneOrCreateNew constructor

AccountModel.cloneOrCreateNew(
  1. AccountModel? inAcc
)

Returns copy of the input account or new account when input is null

Implementation

factory AccountModel.cloneOrCreateNew(AccountModel? inAcc) {
  if(inAcc != null) {
    AccountModel acc = AccountModel.fromJson(inAcc.toJson());
    acc.myAccId = inAcc.myAccId;
    acc.regState = inAcc.regState;
    acc.regText = inAcc.regText;
    return acc;
  } else{
    return AccountModel();
  }
}