fromEntity static method

Future<AppModel?> fromEntity(
  1. String documentID,
  2. AppEntity? entity
)

Implementation

static Future<AppModel?> fromEntity(
    String documentID, AppEntity? entity) async {
  if (entity == null) return null;
  return AppModel(
    documentID: documentID,
    ownerID: entity.ownerID ?? '',
    title: entity.title,
    homeURL: entity.homeURL,
    email: entity.email,
    description: entity.description,
    appStatus: toAppStatus(entity.appStatus),
    homePages: await AppHomePageReferencesModel.fromEntity(entity.homePages),
    styleFamily: entity.styleFamily,
    styleName: entity.styleName,
    autoPrivileged1: entity.autoPrivileged1,
    isFeatured: entity.isFeatured,
    includeShippingAddress: entity.includeShippingAddress,
    includeInvoiceAddress: entity.includeInvoiceAddress,
    includeSubscriptions: entity.includeSubscriptions,
    welcomeMessage: entity.welcomeMessage,
  );
}