fromEntity static method

Future<MonaStyleAttributesModel?> fromEntity(
  1. String documentID,
  2. MonaStyleAttributesEntity? entity
)

Implementation

static Future<MonaStyleAttributesModel?> fromEntity(
    String documentID, MonaStyleAttributesEntity? entity) async {
  if (entity == null) return null;
  return MonaStyleAttributesModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    formBackground: await BackgroundModel.fromEntity(entity.formBackground),
    appBackground: await BackgroundModel.fromEntity(entity.appBackground),
    formGroupTitleColor:
        await RgbModel.fromEntity(entity.formGroupTitleColor),
    formFieldTextColor: await RgbModel.fromEntity(entity.formFieldTextColor),
    formFieldHeaderColor:
        await RgbModel.fromEntity(entity.formFieldHeaderColor),
    formFieldFocusColor:
        await RgbModel.fromEntity(entity.formFieldFocusColor),
    listBackground: await BackgroundModel.fromEntity(entity.listBackground),
    listTextItemColor: await RgbModel.fromEntity(entity.listTextItemColor),
    floatingButtonForegroundColor:
        await RgbModel.fromEntity(entity.floatingButtonForegroundColor),
    floatingButtonBackgroundColor:
        await RgbModel.fromEntity(entity.floatingButtonBackgroundColor),
    dividerColor: await RgbModel.fromEntity(entity.dividerColor),
    topicContainerBackground:
        await BackgroundModel.fromEntity(entity.topicContainerBackground),
    actionContainerBackground:
        await BackgroundModel.fromEntity(entity.actionContainerBackground),
    appBarBG: await BackgroundModel.fromEntity(entity.appBarBG),
    appBarIconColor: await RgbModel.fromEntity(entity.appBarIconColor),
    appBarSelectedIconColor:
        await RgbModel.fromEntity(entity.appBarSelectedIconColor),
    appBarMenuBackgroundColor:
        await RgbModel.fromEntity(entity.appBarMenuBackgroundColor),
    bottomNavigationBarBG:
        await BackgroundModel.fromEntity(entity.bottomNavigationBarBG),
    drawerBG: await BackgroundModel.fromEntity(entity.drawerBG),
    drawerHeaderBG: await BackgroundModel.fromEntity(entity.drawerHeaderBG),
    profileDrawerBG: await BackgroundModel.fromEntity(entity.profileDrawerBG),
    profileDrawerHeaderBG:
        await BackgroundModel.fromEntity(entity.profileDrawerHeaderBG),
    backgroundColorHomeMenu:
        await RgbModel.fromEntity(entity.backgroundColorHomeMenu),
    h1: await FontModel.fromEntity(entity.h1),
    h2: await FontModel.fromEntity(entity.h2),
    h3: await FontModel.fromEntity(entity.h3),
    h4: await FontModel.fromEntity(entity.h4),
    h5: await FontModel.fromEntity(entity.h5),
    textFieldHeader: await FontModel.fromEntity(entity.textFieldHeader),
    fontText: await FontModel.fromEntity(entity.fontText),
    fontSmallText: await FontModel.fromEntity(entity.fontSmallText),
    fontHighlight1: await FontModel.fromEntity(entity.fontHighlight1),
    fontHighlight2: await FontModel.fromEntity(entity.fontHighlight2),
    fontLink: await FontModel.fromEntity(entity.fontLink),
    routeBuilder: toPageTransitionAnimation(entity.routeBuilder),
    routeAnimationDuration: entity.routeAnimationDuration,
    dialogBackgroundColor:
        await RgbModel.fromEntity(entity.dialogBackgroundColor),
    dialogSeperatorColor:
        await RgbModel.fromEntity(entity.dialogSeperatorColor),
    popupMenuButtonColor:
        await RgbModel.fromEntity(entity.popupMenuButtonColor),
    textBubbleBackgroundColor:
        await RgbModel.fromEntity(entity.textBubbleBackgroundColor),
    dropdownButtonnColor:
        await RgbModel.fromEntity(entity.dropdownButtonnColor),
    listTileColor: await RgbModel.fromEntity(entity.listTileColor),
  );
}